-
Notifications
You must be signed in to change notification settings - Fork 40
Add Gamepad API (rework) #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
We are late in the current development cycle to add new features (I am going to release 1.12.0 in the coming days), so let's slate this for 1.14 🕐 |
|
v2:
|
|
I'm wondering if like in #94 there should be a |
aperezdc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall approach looks fine, but I have a bunch of small nits (please bear with me! 🐻)
I don't think it's the case since xkbcommon meant a dependency, and it this case there's no new dependencies. |
bba235d to
5b43554
Compare
aperezdc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only a minor nit before landing this, thanks for the update!
Also, the style checker is complaining. This can be used to apply its suggestions to your work branch:
./scripts/check-style master | git apply -p0896d166 to
cd2790a
Compare
Sorry! I lost track of this. I'm terrible juggling with context switching :) |
donny-dont
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had one nit. Other than that would be great to land this.
Gamepad API in libwpe is middleware between WPEWebKit and the application, such as cog. The application is reponsible to provide the gamepad backend by offering the functions for providers and gamepads. WPEWebkit shall provide event callbacks. Original patch by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
aperezdc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view, this is ready to merge. I'll leave some time for others to comment beforehand, just in case there might be objections (unlikely, I suppose!)
|
I'm positive on this change as well. Thanks @ceyusa can't wait to use it. Could we potentially have a dev release cut after this lands? |
SGTM, I can put out a development release right after. |
|
There hasn't been further comments for a couple of days, so let's get this merged. Note that if we wanted (or needed) to refine these changes, we still have time to make follow-up fixes until September 2022 when the next stable series is due. |
https://bugs.webkit.org/show_bug.cgi?id=230630 With gamepad support in libwpe[1] is possible to communicate gamepads events between the application (cog, for example) and WPEWebKit. This patch are the changes required to attend that communication and enable the gamepad support in WPE port. 1. WebPlatformForEmbedded/libwpe#88 Reviewed by Adrian Perez de Castro. * LayoutTests/platform/wpe/TestExpectations: Enable skipped tests. * Source/WebCore/PlatformWPE.cmake: Add headers if enabled. * Source/WebCore/SourcesWPE.txt: Add source files. * Source/WebCore/platform/gamepad/wpe/WPEGamepad.cpp: Added. (WebCore::WPEGamepad::WPEGamepad): (WebCore::WPEGamepad::~WPEGamepad): (WebCore::WPEGamepad::buttonPressedOrReleased): (WebCore::WPEGamepad::absoluteAxisChanged): * Source/WebCore/platform/gamepad/wpe/WPEGamepad.h: Added. * Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.cpp: Added. (WebCore::WPEGamepadProvider::singleton): (WebCore::WPEGamepadProvider::WPEGamepadProvider): (WebCore::WPEGamepadProvider::~WPEGamepadProvider): (WebCore::WPEGamepadProvider::startMonitoringGamepads): (WebCore::WPEGamepadProvider::stopMonitoringGamepads): (WebCore::WPEGamepadProvider::gamepadConnected): (WebCore::WPEGamepadProvider::gamepadDisconnected): (WebCore::WPEGamepadProvider::indexForNewlyConnectedDevice): (WebCore::WPEGamepadProvider::removeGamepadForId): (WebCore::WPEGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::WPEGamepadProvider::inputNotificationTimerFired): (WebCore::WPEGamepadProvider::scheduleInputNotification): (WebCore::WPEGamepadProvider::inputView): * Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.h: Added. * Source/WebKit/SourcesWPE.txt: Add source files. * Source/WebKit/UIProcess/API/wpe/WPEView.cpp: Reports the view where gamepad currently operates. (WKWPE::m_backend): (WKWPE::View::~View): (WKWPE::View::setViewState): (WKWPE::View::platformWebPageProxyForGamepadInput): * Source/WebKit/UIProcess/API/wpe/WPEView.h: * Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.cpp: * Source/WebKit/UIProcess/Gamepad/wpe/UIGamepadProviderWPE.cpp: Added. (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider): (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput): (WebKit::UIGamepadProvider::platformStopMonitoringInput): (WebKit::UIGamepadProvider::platformStartMonitoringInput): * Source/cmake/OptionsWPE.cmake: Canonical link: https://commits.webkit.org/253720@main
https://bugs.webkit.org/show_bug.cgi?id=230630 With gamepad support in libwpe[1] is possible to communicate gamepads events between the application (cog, for example) and WPEWebKit. This patch are the changes required to attend that communication and enable the gamepad support in WPE port. 1. WebPlatformForEmbedded/libwpe#88 Reviewed by Adrian Perez de Castro. * LayoutTests/platform/wpe/TestExpectations: Enable skipped tests. * Source/WebCore/PlatformWPE.cmake: Add headers if enabled. * Source/WebCore/SourcesWPE.txt: Add source files. * Source/WebCore/platform/gamepad/wpe/WPEGamepad.cpp: Added. (WebCore::WPEGamepad::WPEGamepad): (WebCore::WPEGamepad::~WPEGamepad): (WebCore::WPEGamepad::buttonPressedOrReleased): (WebCore::WPEGamepad::absoluteAxisChanged): * Source/WebCore/platform/gamepad/wpe/WPEGamepad.h: Added. * Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.cpp: Added. (WebCore::WPEGamepadProvider::singleton): (WebCore::WPEGamepadProvider::WPEGamepadProvider): (WebCore::WPEGamepadProvider::~WPEGamepadProvider): (WebCore::WPEGamepadProvider::startMonitoringGamepads): (WebCore::WPEGamepadProvider::stopMonitoringGamepads): (WebCore::WPEGamepadProvider::gamepadConnected): (WebCore::WPEGamepadProvider::gamepadDisconnected): (WebCore::WPEGamepadProvider::indexForNewlyConnectedDevice): (WebCore::WPEGamepadProvider::removeGamepadForId): (WebCore::WPEGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::WPEGamepadProvider::inputNotificationTimerFired): (WebCore::WPEGamepadProvider::scheduleInputNotification): (WebCore::WPEGamepadProvider::inputView): * Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.h: Added. * Source/WebKit/SourcesWPE.txt: Add source files. * Source/WebKit/UIProcess/API/wpe/WPEView.cpp: Reports the view where gamepad currently operates. (WKWPE::m_backend): (WKWPE::View::~View): (WKWPE::View::setViewState): (WKWPE::View::platformWebPageProxyForGamepadInput): * Source/WebKit/UIProcess/API/wpe/WPEView.h: * Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.cpp: * Source/WebKit/UIProcess/Gamepad/wpe/UIGamepadProviderWPE.cpp: Added. (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider): (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput): (WebKit::UIGamepadProvider::platformStopMonitoringInput): (WebKit::UIGamepadProvider::platformStartMonitoringInput): * Source/cmake/OptionsWPE.cmake: Canonical link: https://commits.webkit.org/253720@main (cherry picked from commit ab0e247)
Gamepad API in libwpe is middleware between WPEWebKit and the application, such as cog.
The application is reponsible to provide the gamepad backend, by offering the functions for providers and gamepads. While WPEWebkit shall provide event callbacks.
Original patch by Eugene Mutavchi Ievgen_Mutavchi@comcast.com (in MR #69)