From fb38cf9248e9902e881f9d7c34a35c69583b3614 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 20 Jul 2020 09:54:38 +0200 Subject: [PATCH] Fixed an issue where the screensaver would start immediately after returning from a game. --- es-app/src/FileData.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 9d7c97402..a1b846817 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -545,15 +545,23 @@ void FileData::launchGame(Window* window) Utils::String::toUpper(std::to_string(returnValue) + ")"), 6000); 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 { + #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")) 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");