Fix to windows sleep issues, now with clang format!

This commit is contained in:
vitor-k 2019-09-03 11:06:57 -03:00
parent 285b2b3207
commit bcf33b0ac6

View file

@ -18,6 +18,9 @@
#ifdef __APPLE__
#include <unistd.h> // for chdir
#endif
#ifdef _WIN32
#include <windows.h>
#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>("Core::System::ResultStatus");
qRegisterMetaType<std::string>("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() {