Pause in background guard clause and unused flag
This commit is contained in:
parent
66b1e419c3
commit
05b1cfc63b
@ -32,7 +32,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="toggle_background_pause">
|
<widget class="QCheckBox" name="toggle_background_pause">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Pause emulation when on background</string>
|
<string>Pause emulation when in background</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -500,17 +500,17 @@ void GMainWindow::RestoreUIState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
|
void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
|
||||||
if (UISettings::values.pause_when_in_background) {
|
if (!UISettings::values.pause_when_in_background) {
|
||||||
if (ui.action_Pause->isEnabled() &&
|
return;
|
||||||
(state == Qt::ApplicationSuspended ||
|
}
|
||||||
state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
|
if (ui.action_Pause->isEnabled() &&
|
||||||
auto_paused = true;
|
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
|
||||||
OnPauseGame();
|
auto_paused = true;
|
||||||
}
|
OnPauseGame();
|
||||||
if (ui.action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) {
|
}
|
||||||
auto_paused = false;
|
if (ui.action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) {
|
||||||
OnStartGame();
|
auto_paused = false;
|
||||||
}
|
OnStartGame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user