Fixed an issue where the screensaver would start immediately after returning from a game.

This commit is contained in:
Leon Styhre 2020-07-20 09:54:38 +02:00
parent 5e5da8c52f
commit fb38cf9248

View file

@ -545,15 +545,23 @@ void FileData::launchGame(Window* window)
Utils::String::toUpper(std::to_string(returnValue) + ")"), 6000); Utils::String::toUpper(std::to_string(returnValue) + ")"), 6000);
window->setInfoPopup(s); window->setInfoPopup(s);
} }
#ifdef _WIN64
// This code is only needed for Windows, where we may need to keep ES running while
// the game/emulator is in use. It's basically used to pause any playing game video
// and to keep the screensaver from activating.
else { else {
#ifdef _WIN64
// This code is only needed for Windows, where we may need to keep ES running while
// the game/emulator is in use. It's basically used to pause any playing game video
// and to keep the screensaver from activating.
if (Settings::getInstance()->getBool("RunInBackground")) if (Settings::getInstance()->getBool("RunInBackground"))
window->setLaunchedGame(); window->setLaunchedGame();
else
// Normalize deltaTime so that the screensaver does not start immediately
// when returning from the game.
window->normalizeNextUpdate();
#else
// Normalize deltaTime so that the screensaver does not start immediately
// when returning from the game.
window->normalizeNextUpdate();
#endif
} }
#endif
Scripting::fireEvent("game-end"); Scripting::fireEvent("game-end");