From b03d5837d929ff97b01aee0558520e5a20cd2bb5 Mon Sep 17 00:00:00 2001 From: Squall-Leonhart Date: Sat, 21 Oct 2023 13:34:55 +1100 Subject: [PATCH] Exit Blocked by App Prompt should not fire on Stop Emulation The previous version of this code was nested in a way that was causing Stop Emulation to raise the Confirm Exit dialog immediately. --- src/yuzu/main.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1431cf2fee..153d876aad 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3440,35 +3440,31 @@ void GMainWindow::OnStopGame() { play_time_manager->Stop(); // Update game list to show new play time game_list->PopulateAsync(UISettings::values.game_dirs); - if (OnShutdownBegin()) { - OnShutdownBeginDialog(); - } else { - OnEmulationStopped(); - } + OnEmulationStopped(); } } bool GMainWindow::ConfirmShutdownGame() { + bool showDialog = false; if (UISettings::values.confirm_before_stopping.GetValue() == ConfirmStop::Ask_Always) { if (system->GetExitLocked()) { - if (!ConfirmForceLockedExit()) { - return false; - } + showDialog = ConfirmForceLockedExit(); } else { - if (!ConfirmChangeGame()) { - return false; - } + showDialog = ConfirmChangeGame(); } } else { if (UISettings::values.confirm_before_stopping.GetValue() == ConfirmStop::Ask_Based_On_Game && system->GetExitLocked()) { - if (!ConfirmForceLockedExit()) { - return false; - } + showDialog = ConfirmForceLockedExit(); } } - return true; + + if (showDialog && OnShutdownBegin()) { + OnShutdownBeginDialog(); + } + + return showDialog; } void GMainWindow::OnLoadComplete() {