Title: [282822] trunk/Source/WebCore
- Revision
- 282822
- Author
- [email protected]
- Date
- 2021-09-21 09:37:43 -0700 (Tue, 21 Sep 2021)
Log Message
[iOS] Disable default system gesture on extended gamepad
https://bugs.webkit.org/show_bug.cgi?id=230297
<rdar://65610651>
Reviewed by Brady Eidson.
Prevent default system behavior for some game pad gestures.
Not testable on bots.
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (282821 => 282822)
--- trunk/Source/WebCore/ChangeLog 2021-09-21 16:06:01 UTC (rev 282821)
+++ trunk/Source/WebCore/ChangeLog 2021-09-21 16:37:43 UTC (rev 282822)
@@ -1,3 +1,17 @@
+2021-09-21 Youenn Fablet <[email protected]>
+
+ [iOS] Disable default system gesture on extended gamepad
+ https://bugs.webkit.org/show_bug.cgi?id=230297
+ <rdar://65610651>
+
+ Reviewed by Brady Eidson.
+
+ Prevent default system behavior for some game pad gestures.
+ Not testable on bots.
+
+ * platform/gamepad/cocoa/GameControllerGamepad.mm:
+ (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
+
2021-09-21 Eric Carlson <[email protected]>
Remove unused CGWindowCaptureSource
Modified: trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm (282821 => 282822)
--- trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm 2021-09-21 16:06:01 UTC (rev 282821)
+++ trunk/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm 2021-09-21 16:37:43 UTC (rev 282822)
@@ -28,6 +28,7 @@
#if ENABLE(GAMEPAD)
#import "GameControllerGamepadProvider.h"
#import "GamepadConstants.h"
+#import <GameController/GCControllerElement.h>
#import <GameController/GameController.h>
#import "GameControllerSoftLink.h"
@@ -70,6 +71,16 @@
return nil;
}
+static void disableDefaultSystemAction(GCControllerButtonInput *button)
+{
+#if PLATFORM(IOS_FAMILY)
+ if ([button respondsToSelector:@selector(preferredSystemGestureState)])
+ button.preferredSystemGestureState = GCSystemGestureStateDisabled;
+#else
+ UNUSED_PARAM(button);
+#endif
+}
+
void GameControllerGamepad::setupAsExtendedGamepad()
{
ASSERT(m_extendedGamepad);
@@ -113,13 +124,17 @@
bindButton(m_extendedGamepad.get().dpad.left, GamepadButtonRole::LeftClusterLeft);
bindButton(m_extendedGamepad.get().dpad.right, GamepadButtonRole::LeftClusterRight);
- if (homeButton)
+ if (homeButton) {
bindButton(homeButton, GamepadButtonRole::CenterClusterCenter);
+ disableDefaultSystemAction(homeButton);
+ }
// Select, Start
#if HAVE(GCEXTENDEDGAMEPAD_BUTTONS_OPTIONS_MENU)
bindButton(m_extendedGamepad.get().buttonOptions, GamepadButtonRole::CenterClusterLeft);
+ disableDefaultSystemAction(m_extendedGamepad.get().buttonOptions);
bindButton(m_extendedGamepad.get().buttonMenu, GamepadButtonRole::CenterClusterRight);
+ disableDefaultSystemAction(m_extendedGamepad.get().buttonMenu);
#endif
// L3, R3
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes