1
0
Fork 0
forked from suyu/suyu
This commit is contained in:
Adam Heinermann 2021-12-04 23:06:56 -08:00
parent e482dd82b9
commit 7220056974

View file

@ -1082,14 +1082,15 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
state != Qt::ApplicationActive) {
LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state);
}
if (ui->action_Pause->isEnabled() &&
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
auto_paused = true;
OnPauseGame();
} else if (emulation_running && !emu_thread->IsRunning() && auto_paused &&
state == Qt::ApplicationActive) {
auto_paused = false;
OnStartGame();
if (emulation_running) {
if (emu_thread->IsRunning() &&
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
auto_paused = true;
OnPauseGame();
} else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) {
auto_paused = false;
OnStartGame();
}
}
}