diff options
| -rw-r--r-- | src/yuzu/main.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5a9dec8f3..cc84ea11c 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1082,14 +1082,15 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { | |||
| 1082 | state != Qt::ApplicationActive) { | 1082 | state != Qt::ApplicationActive) { |
| 1083 | LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state); | 1083 | LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state); |
| 1084 | } | 1084 | } |
| 1085 | if (ui->action_Pause->isEnabled() && | 1085 | if (emulation_running) { |
| 1086 | (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { | 1086 | if (emu_thread->IsRunning() && |
| 1087 | auto_paused = true; | 1087 | (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { |
| 1088 | OnPauseGame(); | 1088 | auto_paused = true; |
| 1089 | } else if (emulation_running && !emu_thread->IsRunning() && auto_paused && | 1089 | OnPauseGame(); |
| 1090 | state == Qt::ApplicationActive) { | 1090 | } else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) { |
| 1091 | auto_paused = false; | 1091 | auto_paused = false; |
| 1092 | OnStartGame(); | 1092 | OnStartGame(); |
| 1093 | } | ||
| 1093 | } | 1094 | } |
| 1094 | } | 1095 | } |
| 1095 | 1096 | ||