|
|
@ -1034,14 +1034,14 @@ void GMainWindow::RestoreUIState() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
|
|
|
|
void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
|
|
|
|
if (!UISettings::values.pause_when_in_background) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state != Qt::ApplicationHidden && state != Qt::ApplicationInactive &&
|
|
|
|
if (state != Qt::ApplicationHidden && state != Qt::ApplicationInactive &&
|
|
|
|
state != Qt::ApplicationActive) {
|
|
|
|
state != Qt::ApplicationActive) {
|
|
|
|
LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state);
|
|
|
|
LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (emulation_running) {
|
|
|
|
if (!emulation_running) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (UISettings::values.pause_when_in_background) {
|
|
|
|
if (emu_thread->IsRunning() &&
|
|
|
|
if (emu_thread->IsRunning() &&
|
|
|
|
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
|
|
|
|
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
|
|
|
|
auto_paused = true;
|
|
|
|
auto_paused = true;
|
|
|
@ -1051,6 +1051,16 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
|
|
|
|
OnStartGame();
|
|
|
|
OnStartGame();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (UISettings::values.mute_when_in_background) {
|
|
|
|
|
|
|
|
if (!Settings::values.audio_muted &&
|
|
|
|
|
|
|
|
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
|
|
|
|
|
|
|
|
Settings::values.audio_muted = true;
|
|
|
|
|
|
|
|
auto_muted = true;
|
|
|
|
|
|
|
|
} else if (auto_muted && state == Qt::ApplicationActive) {
|
|
|
|
|
|
|
|
Settings::values.audio_muted = false;
|
|
|
|
|
|
|
|
auto_muted = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::ConnectWidgetEvents() {
|
|
|
|
void GMainWindow::ConnectWidgetEvents() {
|
|
|
|