(RPi) Fixed an issue where the window focus would sometimes get lost when returning from a game.

This commit is contained in:
Leon Styhre 2021-07-14 19:19:45 +02:00
parent ea0d129e6d
commit 977ab5e683

View file

@ -100,6 +100,14 @@ int launchGameUnix(const std::string& cmd_utf8, bool runInBackground)
}
returnValue = pclose(commandPipe);
#if defined(_RPI_)
// Hack to avoid that the application window occasionally loses focus when returning from
// a game, which only seems to happen on the Raspberry Pi.
SDL_Delay(50);
SDL_SetWindowInputFocus(Renderer::getSDLWindow());
#endif
// We need to shift the return value as it contains some flags (which we don't need).
returnValue >>= 8;