Bug 35064 - windowless plugins don't get button press events for right mouse button
Summary: windowless plugins don't get button press events for right mouse button
Status: RESOLVED DUPLICATE of bug 29177
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-17 17:45 PST by Brian Tarricone
Modified: 2010-02-19 16:56 PST (History)
0 users

See Also:


Attachments
don't drop right mouse press events if the frame doesn't handle them (1.58 KB, patch)
2010-02-17 18:45 PST, Brian Tarricone
no flags Details | Formatted Diff | Diff
previous patch + style fix (1.58 KB, patch)
2010-02-17 18:47 PST, Brian Tarricone
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 ***