diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 6ddc736a..7d27e095 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -2194,7 +2194,14 @@ void Session::exec() // Hijack this thread to be the SDL main thread. We have to do this // because we want to suspend all Qt processing until the stream is over. SDL_Event event; + uint32_t nextGamepadPollTime = SDL_GetTicks(); for (;;) { + uint32_t now = SDL_GetTicks(); + if (SDL_TICKS_PASSED(now, nextGamepadPollTime)) { + m_InputHandler->pollForMissingGamepads(); + nextGamepadPollTime = now + 250; + } + #if SDL_VERSION_ATLEAST(2, 0, 18) && !defined(STEAM_LINK) // SDL 2.0.18 has a proper wait event implementation that uses platform // support to block on events rather than polling on Windows, macOS, X11, @@ -2206,7 +2213,6 @@ void Session::exec() // issues that could cause indefinite timeouts, delayed joystick detection, // and other problems. if (!SDL_WaitEventTimeout(&event, 1000)) { - m_InputHandler->pollForMissingGamepads(); updateEffectiveAudioMuteState(); presence.runCallbacks(); continue;