SDL: GameInput: don't say the device is present if we won't handle it

From 71d0d069edf49eaed63762ea0d593e7296cff357 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 28 Apr 2026 15:31:10 -0700
Subject: [PATCH] GameInput: don't say the device is present if we won't handle
 it

---
 src/joystick/gdk/SDL_gameinputjoystick.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/joystick/gdk/SDL_gameinputjoystick.cpp b/src/joystick/gdk/SDL_gameinputjoystick.cpp
index bb511dda2bede..c1c57a43b360f 100644
--- a/src/joystick/gdk/SDL_gameinputjoystick.cpp
+++ b/src/joystick/gdk/SDL_gameinputjoystick.cpp
@@ -487,7 +487,9 @@ static bool GAMEINPUT_JoystickIsDevicePresent(Uint16 vendor_id, Uint16 product_i
         if (vendor_id == USB_VENDOR_MICROSOFT &&
             product_id == USB_PRODUCT_XBOX_ONE_XBOXGIP_CONTROLLER) {
             // The Xbox One controller shows up as a hardcoded raw input VID/PID, which we definitely handle
-            return true;
+            if (SDL_GetHintBoolean(SDL_HINT_JOYSTICK_GAMEINPUT, SDL_GAMEINPUT_DEFAULT)) {
+                return true;
+            }
         }
 
         for (int i = 0; i < g_GameInputList.count; ++i) {