From fa04f0970e2435f0bf4077a696b795729f1da07b Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Wed, 7 Oct 2015 01:10:39 +0300 Subject: [PATCH] gui: ESC on fullscreen: better resilience Make sure we exit fullscreen only if the GS window is visible and in fullscreen. While we don't currently have such cases, it's possible that the Sys_Suspend command is called while it's already suspended (and the GS window is hidden) but the code without this patch would have incorrectly made it visible again. --- pcsx2/gui/GlobalCommands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index d1327e0934..d5d944eba8 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -282,7 +282,7 @@ namespace Implementations void Sys_Suspend() { GSFrame* gsframe = wxGetApp().GetGsFramePtr(); - if (gsframe) { + if (gsframe && gsframe->IsShown() && gsframe->IsFullScreen()) { // On some cases, probably due to driver bugs, if we don't exit fullscreen then // the content stays on screen. Try to prevent that by first exiting fullscreen, // but don't update the internal PCSX2 state/config, and PCSX2 will restore