diff options
| author | 2021-12-07 18:28:16 -0500 | |
|---|---|---|
| committer | 2021-12-07 18:28:16 -0500 | |
| commit | 5b2cb22a049f324dc59f47b032c5340974f72d84 (patch) | |
| tree | 221dd8ebea5511615320d74d07e7fd82b472fe62 | |
| parent | Merge pull request #7522 from ameerj/shader-recompiler-filenames (diff) | |
| parent | Fixed #7502 (diff) | |
| download | yuzu-5b2cb22a049f324dc59f47b032c5340974f72d84.tar.gz yuzu-5b2cb22a049f324dc59f47b032c5340974f72d84.tar.xz yuzu-5b2cb22a049f324dc59f47b032c5340974f72d84.zip | |
Merge pull request #7506 from heinermann/focus_crash
Fixed #7502
| -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 | ||