master
Adam Heinermann 2021-12-04 23:06:56 +07:00
parent e482dd82b9
commit 7220056974
1 changed files with 9 additions and 8 deletions

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