Commit 87f8b6ff0f89ae572056301b1361a5db9be8b4cb

Sam Lantinga 2022-09-07T01:21:01

Don't mess with the state of the Motion Plus extension on Linux

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/joystick/hidapi/SDL_hidapi_wii.c b/src/joystick/hidapi/SDL_hidapi_wii.c
index 7fd3d01..09d23be 100644
--- a/src/joystick/hidapi/SDL_hidapi_wii.c
+++ b/src/joystick/hidapi/SDL_hidapi_wii.c
@@ -463,9 +463,15 @@ static void CheckMotionPlusConnection(SDL_DriverWii_Context *ctx)
 
 static void ActivateMotionPlusWithMode(SDL_DriverWii_Context *ctx, Uint8 mode)
 {
+#if defined(__LINUX__)
+    /* Linux drivers maintain a lot of state around the Motion Plus
+     * extension, so don't mess with it here.
+     */
+#else
     WriteRegister(ctx, 0xA600FE, &mode, sizeof(mode), SDL_TRUE);
 
     ctx->m_ucMotionPlusMode = mode;
+#endif /* LINUX */
 }
 
 static void ActivateMotionPlus(SDL_DriverWii_Context *ctx)