citra-emu
/
citra
Archived
1
0
Fork 0

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
1 changed files with 15 additions and 0 deletions

View File

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