mirror of https://github.com/PCSX2/pcsx2.git
GS window: try to fix ESC on fullscreen sometimes not exiting correctly
This tries to emulate LilyPad's "Safe fullscreen exit on escape" hack, and hopefully also makes this LilyPad hack redundant, such that it would fix the issue also with other input plugins.
This commit is contained in:
parent
4522418890
commit
9c1688a39a
|
@ -441,12 +441,12 @@ void GSFrame::OnCloseWindow(wxCloseEvent& evt)
|
|||
Hide(); // and don't close it.
|
||||
}
|
||||
|
||||
bool GSFrame::ShowFullScreen(bool show)
|
||||
bool GSFrame::ShowFullScreen(bool show, bool updateConfig)
|
||||
{
|
||||
/*if( show != IsFullScreen() )
|
||||
Console.WriteLn( Color_StrongMagenta, "(gsFrame) Switching to %s mode...", show ? "Fullscreen" : "Windowed" );*/
|
||||
|
||||
if( g_Conf->GSWindow.IsFullscreen != show )
|
||||
if (updateConfig && g_Conf->GSWindow.IsFullscreen != show)
|
||||
{
|
||||
g_Conf->GSWindow.IsFullscreen = show;
|
||||
wxGetApp().PostIdleMethod( AppSaveSettings );
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
bool Show( bool shown=true );
|
||||
wxStaticText* GetLabel_OutputDisabled() const;
|
||||
|
||||
bool ShowFullScreen(bool show);
|
||||
bool ShowFullScreen(bool show, bool updateConfig = true);
|
||||
|
||||
protected:
|
||||
void OnCloseWindow( wxCloseEvent& evt );
|
||||
|
|
|
@ -281,9 +281,20 @@ namespace Implementations
|
|||
|
||||
void Sys_Suspend()
|
||||
{
|
||||
GSFrame* gsframe = wxGetApp().GetGsFramePtr();
|
||||
if (gsframe) {
|
||||
// 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
|
||||
// fullscreen correctly when emulation resumes according to its state/config.
|
||||
// This is similar to what LilyPad's "Safe fullscreen exit on escape" hack does,
|
||||
// and thus hopefully makes LilyPad's hack redundant.
|
||||
gsframe->ShowFullScreen(false, false);
|
||||
}
|
||||
|
||||
CoreThread.Suspend();
|
||||
|
||||
GSFrame* gsframe = wxGetApp().GetGsFramePtr();
|
||||
gsframe = wxGetApp().GetGsFramePtr(); // just in case suspend removes this window
|
||||
if (gsframe && !wxGetApp().HasGUI() && g_Conf->GSWindow.CloseOnEsc) {
|
||||
// When we run with --nogui, PCSX2 only knows to exit when the gs window closes.
|
||||
// However, by default suspend just hides the gs window, so PCSX2 will not exit
|
||||
|
|
Loading…
Reference in New Issue