Skip to content

Commit 964b9da

Browse files
committed
Fixed detecting Steam Deck controller on Proton 9.04
Newer versions of Proton properly pass through the Steam virtual gamepad VID/PID, but older Proton (9.x and older) don't, so we have to rely on Steam and Proton hiding controllers we shouldn't have access to. Fixes libsdl-org#12106 (cherry picked from commit da0cf3f)
1 parent 364abb8 commit 964b9da

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/joystick/SDL_gamecontroller.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,9 +2126,16 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid)
21262126

21272127
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, &version, NULL);
21282128

2129+
#ifdef __WIN32__
2130+
if (SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE)) {
2131+
/* We're running under Steam and it will hide any controllers that we shouldn't open */
2132+
return FALSE;
2133+
}
2134+
#else
21292135
if (SDL_IsJoystickSteamVirtualGamepad(vendor, product, version)) {
21302136
return !SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE);
21312137
}
2138+
#endif
21322139

21332140
if (SDL_allowed_controllers.num_included_entries > 0) {
21342141
if (SDL_VIDPIDInList(vendor, product, &SDL_allowed_controllers)) {

0 commit comments

Comments
 (0)