Bug 140967

Summary: Immediate action gesture recognizer still doesn't work well with IB
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, mitz, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
thorton: review-
Patch thorton: review+

Description Beth Dakin 2015-01-27 15:54:28 PST
Immediate action gesture recognizer still doesn't work well with IB

rdar://problem/19621509
Comment 1 Beth Dakin 2015-01-27 16:00:11 PST
Created attachment 245489 [details]
Patch
Comment 2 Tim Horton 2015-01-27 16:30:16 PST
Comment on attachment 245489 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=245489&action=review

> Source/WebKit2/UIProcess/API/mac/WKView.mm:2571
> +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000

It looks to me (with a tiny test app) like you're not guaranteed to move to a nil window when moving between windows, so I think this needs to be restructured to avoid re-adding the GR.

> Source/WebKit2/UIProcess/API/mac/WKView.mm:2576
> +            [self addGestureRecognizer:_data->_immediateActionGestureRecognizer.get()];

We could keep the controller/GR instantiation in init/commoninit and just add/remove here, for minimal change, if you want.

> Source/WebKit2/UIProcess/API/mac/WKView.mm:2593
> +        if (NSClassFromString(@"NSImmediateActionGestureRecognizer"))

This could check _immediateActionGestureRecognizer instead of this.
Comment 3 Beth Dakin 2015-01-27 16:53:52 PST
Created attachment 245494 [details]
Patch
Comment 4 Tim Horton 2015-01-27 16:59:38 PST
Comment on attachment 245494 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=245494&action=review

> Source/WebKit/mac/WebView/WebView.mm:5300
> +            if (![[self gestureRecognizers] containsObject:recognizer])

As discussed, I think we should not add the GR if _data->_ignoresNonWheelEvents is true.
Comment 5 Beth Dakin 2015-01-27 17:07:18 PST
Thank you! http://trac.webkit.org/changeset/179230