Bug 160699 - [WK2] Only send gamepad input events to the currently focused page
Summary: [WK2] Only send gamepad input events to the currently focused page
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks: 134076 134675
  Show dependency treegraph
 
Reported: 2016-08-09 11:19 PDT by Brady Eidson
Modified: 2016-08-10 17:00 PDT (History)
2 users (show)

See Also:


Attachments
Patch v1 (17.02 KB, patch)
2016-08-09 16:34 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
Attempt to fix 32bit build (16.86 KB, patch)
2016-08-09 16:57 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
Another 32bit build fix attempt (16.83 KB, patch)
2016-08-09 17:08 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
Yay much better (15.66 KB, patch)
2016-08-09 17:19 PDT, Brady Eidson
thorton: review+
Details | Formatted Diff | Diff
Now with more building, and for landing. (15.68 KB, patch)
2016-08-09 17:26 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff

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