diff --git a/pcsx2/gui/AppCorePlugins.cpp b/pcsx2/gui/AppCorePlugins.cpp index fff49f3870..4a3c43c3e8 100644 --- a/pcsx2/gui/AppCorePlugins.cpp +++ b/pcsx2/gui/AppCorePlugins.cpp @@ -363,7 +363,8 @@ bool AppCorePlugins::OpenPlugin_GS() void AppCorePlugins::ClosePlugin_GS() { _parent::ClosePlugin_GS(); - if( GetMTGS().IsSelf() && GSopen2 ) sApp.CloseGsPanel(); + if (CloseViewportWithPlugins && GetMTGS().IsSelf() && GSopen2) + sApp.CloseGsPanel(); } diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index ec1281e509..6a00b7a3ff 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -1024,13 +1024,29 @@ void Pcsx2App::OpenGsPanel() void Pcsx2App::CloseGsPanel() { - if( AppRpc_TryInvoke( &Pcsx2App::CloseGsPanel ) ) return; + if (AppRpc_TryInvoke(&Pcsx2App::CloseGsPanel)) + return; if (CloseViewportWithPlugins) { if (GSFrame* gsFrame = GetGsFramePtr()) - if (GSPanel* woot = gsFrame->GetViewport()) - woot->Destroy(); + if (GSPanel* woot = gsFrame->GetViewport()) + woot->Destroy(); + } +} + +void Pcsx2App::OnGsFrameClosed(wxWindowID id) +{ + if ((m_id_GsFrame == wxID_ANY) || (m_id_GsFrame != id)) + return; + + CoreThread.Suspend(); + + if (!m_UseGUI) + { + // The user is prompted before suspending (at Sys_Suspend() ), because + // right now there's no way to resume from suspend without GUI. + PrepForExit(); } #ifndef DISABLE_RECORDING // Disable recording controls that only make sense if the game is running @@ -1040,20 +1056,6 @@ void Pcsx2App::CloseGsPanel() #endif } -void Pcsx2App::OnGsFrameClosed( wxWindowID id ) -{ - if( (m_id_GsFrame == wxID_ANY) || (m_id_GsFrame != id) ) return; - - CoreThread.Suspend(); - - if( !m_UseGUI ) - { - // The user is prompted before suspending (at Sys_Suspend() ), because - // right now there's no way to resume from suspend without GUI. - PrepForExit(); - } -} - void Pcsx2App::OnProgramLogClosed( wxWindowID id ) { if( (m_id_ProgramLogBox == wxID_ANY) || (m_id_ProgramLogBox != id) ) return;