From e4d8af0c97875526a325aa941c6d9acf7152e183 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Tue, 6 Oct 2015 01:55:18 +0300 Subject: [PATCH] gui: exit prompt for --noguiprompt: suspend while visible When using --nogui and --noguiprompt and the user presses ESC, a prompt is displayed asking the user to confirm exiting/closing PCSX2. This patch suspends the emulation while this prompt is displayed. Also updated the comment that if LilyPad has "safe fullscreen exit on ESC", then full screen is not restored automatically if this prompt is canceled. --- pcsx2/gui/GlobalCommands.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index 5aa1769805..4489b05577 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -281,6 +281,8 @@ namespace Implementations void Sys_Suspend() { + CoreThread.Suspend(); + GSFrame* gsframe = wxGetApp().GetGsFramePtr(); if (gsframe && !wxGetApp().HasGUI() && g_Conf->GSWindow.CloseOnEsc) { // When we run with --nogui, PCSX2 only knows to exit when the gs window closes. @@ -303,16 +305,17 @@ namespace Implementations else { // aborting suspend request - // TODO: It's likely that if we were full screen before showing the - // prompt then we're now not in full screen anymore. It would have - // been ideal to restore full screen, but the full screen flow is complex - // and specifically gsframe->IsFullScreen() is always false when we enter - // this function - even if we were full screen before displaying the prompt. + // Note: if LilyPad is configured to "Safe fullscreen exit on ESC", + // then pressing escape will also exit full screen, but won't restore full screen + // when emulation is resumed if the user doesn't want to exit PCSX2 after the prompt. + // So when using --nogui and --noguiprompt, consider disabling this option at Lilypad. + // Not sure yet why when using the GUI (without --nogiu), it does know to restore + // full screen even if this option is enabled at LilyPad. + CoreThread.Resume(); return; } } - CoreThread.Suspend(); sMainFrame.SetFocus(); }