Bug 35064

Summary: windowless plugins don't get button press events for right mouse button
Product: WebKit Reporter: Brian Tarricone <bjt23>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
don't drop right mouse press events if the frame doesn't handle them
none
previous patch + style fix none

Description Brian Tarricone 2010-02-17 17:45:38 PST
I'm not getting any button press events for right clicks in my windowless plugin.  Interestingly, I do get button *release* for the right button, just no press.

I'm digging around, but I'm not sure if I'm looking in the right place.  The behavior seems weird: I added some printfs to PlatformMouseEvent's constructor, and I see that for a right press, *two* PlatformMouseEvents get generated (whereas for left or middle press, only one gets generated).  Looking at dom/MouseEvent, it looks like initMouseEvent() never gets called (for *any* button press), so I think I'm not understanding how this works.

Any ideas as for the right place to look would be appreciated.  I've looked around in page/gtk/EventHandlerGtk.cpp, but nothing is jumping out at me there.
Comment 1 Brian Tarricone 2010-02-17 18:45:20 PST
Created attachment 48958 [details]
don't drop right mouse press events if the frame doesn't handle them

Ok, I think I figured it out.  The gtk WebKitWebView button-press-event handler was dropping the right press if EventHandler::sendContextMenuEvent() chose not to handle the event (which is the case when you right-click over a windowless plugin).  I *think* the correct behavior is that the button-press-event handler should handle the event as usual if webkit_web_view_forward_context_menu_event() returns FALSE.  This patch does just that.
Comment 2 Brian Tarricone 2010-02-17 18:47:12 PST
Created attachment 48959 [details]
previous patch + style fix

Of course I notice the style issue *right* after I click submit.  Fixed.
Comment 3 Gustavo Noronha (kov) 2010-02-18 06:10:10 PST
Comment on attachment 48959 [details]
previous patch + style fix

hmm, so, this is related to this other patch: https://bugs.webkit.org/show_bug.cgi?id=29177

Can you test if that patch fixes the issue for you? It would be good to add layout testing to this.
Comment 4 Brian Tarricone 2010-02-18 12:20:33 PST
Yes, that patch works as well, and from my reading of it appears to be more correct too.

*** This bug has been marked as a duplicate of bug 29177 ***