diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index fe8f60e251..d0060f6901 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -18,6 +18,9 @@ #ifdef __APPLE__ #include // for chdir #endif +#ifdef _WIN32 +#include +#endif #include "citra_qt/aboutdialog.h" #include "citra_qt/applets/mii_selector.h" #include "citra_qt/applets/swkbd.h" @@ -899,6 +902,10 @@ void GMainWindow::ShutdownGame() { return; } +#ifdef _WIN32 + SetThreadExecutionState(ES_CONTINUOUS); +#endif + discord_rpc->Pause(); OnStopRecordingPlayback(); emu_thread->RequestStop(); @@ -1216,6 +1223,10 @@ void GMainWindow::OnStartGame() { movie_record_path.clear(); } +#ifdef _WIN32 + SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); +#endif + emu_thread->SetRunning(true); qRegisterMetaType("Core::System::ResultStatus"); qRegisterMetaType("std::string"); @@ -1243,6 +1254,10 @@ void GMainWindow::OnPauseGame() { ui.action_Pause->setEnabled(false); ui.action_Stop->setEnabled(true); ui.action_Capture_Screenshot->setEnabled(false); + +#ifdef _WIN32 + SetThreadExecutionState(ES_CONTINUOUS); +#endif } void GMainWindow::OnStopGame() {