Bug 160699

Summary: [WK2] Only send gamepad input events to the currently focused page
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit2Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 134076, 134675    
Attachments:
Description Flags
Patch v1
none
Attempt to fix 32bit build
none
Another 32bit build fix attempt
none
Yay much better
thorton: review+
Now with more building, and for landing. none

Description Brady Eidson 2016-08-09 11:19:29 PDT
[WK2] Only send gamepad input events to the currently focused page
Comment 1 Brady Eidson 2016-08-09 16:34:03 PDT
Created attachment 285688 [details]
Patch v1
Comment 2 Brady Eidson 2016-08-09 16:57:54 PDT
Created attachment 285692 [details]
Attempt to fix 32bit build
Comment 3 Tim Horton 2016-08-09 17:04:28 PDT
Comment on attachment 285692 [details]
Attempt to fix 32bit build

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

> Source/WebKit2/UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:41
> +    if ([responder class] == [WKWebView class])

This is very wrong, you want [responder isKindOfClass:[WKWebView class]] (and below). Otherwise subclasses will fail.
Comment 4 Tim Horton 2016-08-09 17:06:05 PDT
Comment on attachment 285692 [details]
Attempt to fix 32bit build

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

> Source/WebKit2/UIProcess/API/mac/WKView.mm:873
> +- (WebPageProxy*) _webPageProxy

instead of adding this, can't you toImpl(webView.pageRef) or something like that?
Comment 5 Brady Eidson 2016-08-09 17:08:53 PDT
Created attachment 285694 [details]
Another 32bit build fix attempt
Comment 6 Brady Eidson 2016-08-09 17:14:07 PDT
(In reply to comment #3)
> Comment on attachment 285692 [details]
> Attempt to fix 32bit build
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=285692&action=review
> 
> > Source/WebKit2/UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:41
> > +    if ([responder class] == [WKWebView class])
> 
> This is very wrong, you want [responder isKindOfClass:[WKWebView class]]
> (and below). Otherwise subclasses will fail.

Right.

(In reply to comment #4)
> Comment on attachment 285692 [details]
> Attempt to fix 32bit build
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=285692&action=review
> 
> > Source/WebKit2/UIProcess/API/mac/WKView.mm:873
> > +- (WebPageProxy*) _webPageProxy
> 
> instead of adding this, can't you toImpl(webView.pageRef) or something like
> that?

Oooooh toImpl...  okay.
Comment 7 Brady Eidson 2016-08-09 17:19:56 PDT
Created attachment 285696 [details]
Yay much better
Comment 8 Brady Eidson 2016-08-09 17:26:57 PDT
Created attachment 285698 [details]
Now with more building, and for landing.
Comment 9 WebKit Commit Bot 2016-08-09 17:27:51 PDT
Attachment 285698 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:31:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 WebKit Commit Bot 2016-08-09 17:51:02 PDT
Comment on attachment 285698 [details]
Now with more building, and for landing.

Clearing flags on attachment: 285698

Committed r204318: <http://trac.webkit.org/changeset/204318>