SDL: Don't treat the Nintendo IMU as a separate game controller on Linux

From 6432f45a1cfcac5fa782a8c200cecf295c7b9665 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 8 Nov 2022 10:27:21 -0800
Subject: [PATCH] Don't treat the Nintendo IMU as a separate game controller on
 Linux

---
 src/joystick/SDL_gamecontroller.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index bd30029b973f..2bb97657b253 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -1999,6 +1999,10 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid)
         /* Don't treat the PS3 and PS4 motion controls as a separate game controller */
         return SDL_TRUE;
     }
+    if (SDL_strncmp(name, "Nintendo ", 9) == 0 && SDL_strstr(name, " IMU") != NULL) {
+        /* Don't treat the Nintendo IMU as a separate game controller */
+        return SDL_TRUE;
+    }
     if (SDL_endswith(name, " Accelerometer") ||
         SDL_endswith(name, " IR") ||
         SDL_endswith(name, " Motion Plus") ||