Bug 47137 - Notification onclick() events don't act like user gestures
Summary: Notification onclick() events don't act like user gestures
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Andrew Wilson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-04 18:20 PDT by Andrew Wilson
Modified: 2010-10-05 13:41 PDT (History)
3 users (show)

See Also:


Attachments
Updated chromium and qt notification implementations to mark click events as user gestures. (3.20 KB, patch)
2010-10-05 09:45 PDT, Andrew Wilson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Wilson 2010-10-04 18:20:06 PDT
I am trying to focus a window in the onclick handler for a notification, but it fails because WebKit doesn't think notification.onclick is a user gesture.

The problem is that Event::fromUserGesture() is returning false because UserGestureIndicator::processingUserGesture() is returning false.

I think the fix is to add a line like this to WebNotification::dispatchClickEvent():

UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);

I have a patch locally that does this which I'll try out tomorrow. I can make this change for the qt client also - is there any place else I need to touch?
Comment 1 Andrew Wilson 2010-10-05 09:45:57 PDT
Created attachment 69799 [details]
Updated chromium and qt notification implementations to mark click events as user gestures.
Comment 2 Yael 2010-10-05 10:10:20 PDT
Thank you for fixing it for Qt.
Looks good to me (but I am not a reviewer :-)
Comment 3 John Gregg 2010-10-05 10:19:49 PDT
Patch looks good for chromium too (also not a reviewer).
Comment 4 Andreas Kling 2010-10-05 13:21:11 PDT
Comment on attachment 69799 [details]
Updated chromium and qt notification implementations to mark click events as user gestures.

LGTM, too. Thanks Yael and John!
Comment 5 WebKit Commit Bot 2010-10-05 13:41:29 PDT
Comment on attachment 69799 [details]
Updated chromium and qt notification implementations to mark click events as user gestures.

Clearing flags on attachment: 69799

Committed r69143: <http://trac.webkit.org/changeset/69143>
Comment 6 WebKit Commit Bot 2010-10-05 13:41:34 PDT
All reviewed patches have been landed.  Closing bug.