[WK2] Don't monitor gamepads at all unless an interested WebPageProxy is in the active window
Created attachment 285786 [details] Patch v1
Comment on attachment 285786 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=285786&action=review > Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:1061 > + UIGamepadProvider::singleton().webPageBecameActive(m_page.get()); Don't know if this is the best name for this. It's not about a "web page". > Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp:160 > +void UIGamepadProvider::webPageBecameActive(WebPageProxy& page) Don't you want windowIsKey && webViewIsFirstResponder? Or is the first-responderiness covered by m_processPoolsUsingGamepads? > Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.h:83 > + WebCore::Timer m_gamepadSyncTimer; > + WebCore::Timer m_disableMonitoringTimer; Isn't using WebCore::Timer in the UI process a big no-no? (because of coexistence with the Web thread) I think you should be using the runloop timer thingy.
(In reply to comment #2) > Comment on attachment 285786 [details] > Patch v1 > > View in context: > https://bugs.webkit.org/attachment.cgi?id=285786&action=review > > > Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp:160 > > +void UIGamepadProvider::webPageBecameActive(WebPageProxy& page) > > Don't you want windowIsKey && webViewIsFirstResponder? Or is the > first-responderiness covered by m_processPoolsUsingGamepads? > As we need it both at registration time and "event firing" time, first responderiness is covered by platformWebPageProxyForGamepadInput,
Fixing the other stuff and building ATM
Created attachment 285877 [details] PFL
Comment on attachment 285877 [details] PFL Clearing flags on attachment: 285877 Committed r204401: <http://trac.webkit.org/changeset/204401>
This works.