From b51dccd969447ef66eff01b1625ee5d038279799 Mon Sep 17 00:00:00 2001 From: Valiantsin Dzerakh Date: Wed, 25 Nov 2026 16:32:57 +0300 Subject: [PATCH] The Steam check of pad_background is left out on Windows, where the game window is not SDL's: the hint stays on there as before (#1462) Co-Authored-By: Claude Opus 5.5 --- runtime/input.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/input.c b/runtime/input.c index 4a68b772..919a4fae 100644 --- a/runtime/input.c +++ b/runtime/input.c @@ -675,9 +675,14 @@ static void start(void) { // so the hint can stay on for the whole run. A game Steam started is the exception (input_pad_background_pick): // Steam's overlay and menus take the focus while they are open, and the presses meant for them reached the game // too (#1462). Steam sets SteamGameId for its own games and for non-Steam shortcuts, SteamOverlayGameId with the - // overlay. TOTK_PAD_BACKGROUND = 1 or 0 decides it either way. + // overlay. TOTK_PAD_BACKGROUND = 1 or 0 decides it either way. On Windows the game window is not SDL's, so SDL never + // drops events for focus there and the Steam check is left out: the hint stays as it was. +#ifdef _WIN32 + int under_steam = 0; +#else const char *gid = getenv("SteamGameId"), *ogid = getenv("SteamOverlayGameId"); int under_steam = (gid && *gid) || (ogid && *ogid); +#endif const char *bg = cfg_value("TOTK_PAD_BACKGROUND"); if (input_pad_background_pick(bg, under_steam)) SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); else