It can be reproduced by right clicking on a link, the popup menu is deactivated right after showing it unless mouse button is not released. The problem is that we are passing GDK_CURRENT_TIME (which is 0) to gtk_popup_menu, because the eventas are async and gtk_get_current_event will be NULL when calling gtk_menu_popup. GtkMenu has a timeout to decide whether the press-release was fast enough and ignore the button release event in that case. That way, a normal right click shows the menu while a long press hides the menuwhen the button is released. So, we need to know the real time when the right button was pressed and pass it to gtk_popup_menu.
Created attachment 120751 [details]
Ah!, and the reason why it works when the first item is not disabled is because when the timeout is passed, the button release event is also ignored if the first menu item (that receives the release event) is not sentitive.
Comment on attachment 120751 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=120751&action=review
> + // WebPopupMenuProxy::Client
If you leave a comment here, I think it should be a full sentence here. "Called by WebPopupMenuProxy::Client." for instance.
(In reply to comment #3)
> (From update of attachment 120751 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=120751&action=review
> > Source/WebKit2/UIProcess/WebPageProxy.h:595
> > + // WebPopupMenuProxy::Client
> If you leave a comment here, I think it should be a full sentence here. "Called by WebPopupMenuProxy::Client." for instance.
It's an existing comment, just copied, see:
And it means that those methods are the implementation of the WebPopupMenuProxy::Client virtual methods.
Committed r103802: <http://trac.webkit.org/changeset/103802>