Bug 13298 - Widget needs a virtual method to be notified of mouse capture changes
Summary: Widget needs a virtual method to be notified of mouse capture changes
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Windows XP
: P4 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-06 14:42 PDT by Matt Perry
Modified: 2010-06-10 14:30 PDT (History)
1 user (show)

See Also:


Attachments
add captureChanged virtual method (2.00 KB, patch)
2007-04-06 14:43 PDT, Matt Perry
hyatt: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Perry 2007-04-06 14:42:13 PDT
On Windows, mouse capture can be changed externally from the application.  In these situations, the porting layer needs to notify the widget that it's capture has changed, in a way that can be handled differently for different widgets.

Patch coming.
Comment 1 Matt Perry 2007-04-06 14:43:27 PDT
Created attachment 13982 [details]
add captureChanged virtual method
Comment 2 Dave Hyatt 2007-04-06 14:49:41 PDT
Comment on attachment 13982 [details]
add captureChanged virtual method

I do not understand why this is necessary.
Comment 3 Dave Hyatt 2007-04-06 15:15:21 PDT
See checkin for bug  13274.  I eliminated the notion of Widget-level capture.
Comment 4 Dave Hyatt 2007-04-06 15:26:51 PDT
If this was for scrollbar, as part of 13274 I made EventHandler smart enough to handle scrollbar capture too.
Comment 5 Matt Perry 2007-04-06 16:05:23 PDT
Sorry, I hadn't updated to the latest revision.  I see that the Windows-specific capture methods are now gone.

However, I think we still need a way to notify WebCore (maybe the EventHandler, or the capturing widget itself?) that capture has been removed.  It will not always happen on mouse-up.  On Windows, if a window has capture, and (for example) you press Alt+Tab, capture is removed and a WM_CANCELMODE message is sent to that window.  Widgets will need to be notified of this.
Comment 6 Dave Hyatt 2007-04-06 16:07:49 PDT
I think my preference would be to synthesize a mouse up event and send it in to WebCore when that happens.
Comment 7 Dave Hyatt 2007-04-06 16:08:19 PDT
Is Alt+Tab the only example?  It seems pretty unlikely that a user would hit those keys while holding down the mouse. :)
Comment 8 Matt Perry 2007-04-06 16:22:25 PDT
I think capture can be stolen in other cases as well.  Perhaps if a new window pops up and takes focus.

A mouse-up event seems reasonable, as long as it's unlikely to interfere with pages that watch for mouse-up javascript events.
Comment 9 David Kilzer (:ddkilzer) 2007-04-06 18:17:59 PDT
Reopening bug as discussion is ongoing.
Comment 10 Dave Hyatt 2007-04-06 18:21:15 PDT
The reason I say do a mouse up is that a page that is using JS events to do its own "capturing" sort of behavior would also get stuck if it doesn't get the up.
Comment 11 Oliver Hunt 2007-04-06 19:04:56 PDT
We'd need to be careful when synthesizing the mouse up event, eg. take the case where a weebpage uses js to implement buttons manually (because we all want to do that), if we send a mouse up when we lose focus it could be interpreted as a "click" and then badness could ensue.
Comment 12 Dave Hyatt 2007-04-06 20:33:50 PDT
Lowering priority, since none of these cases are critical.