mirror of https://github.com/PCSX2/pcsx2.git
gs: make sure gspanel close doesn't starve corethread events
This commit is contained in:
parent
2384a3d172
commit
8dd9af23d4
|
@ -43,9 +43,11 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
//#define GSWindowScaleDebug
|
||||||
|
|
||||||
static const KeyAcceleratorCode FULLSCREEN_TOGGLE_ACCELERATOR_GSPANEL=KeyAcceleratorCode( WXK_RETURN ).Alt();
|
static const KeyAcceleratorCode FULLSCREEN_TOGGLE_ACCELERATOR_GSPANEL=KeyAcceleratorCode( WXK_RETURN ).Alt();
|
||||||
|
|
||||||
//#define GSWindowScaleDebug
|
extern std::atomic_bool init_gspanel;
|
||||||
|
|
||||||
void GSPanel::InitDefaultAccelerators()
|
void GSPanel::InitDefaultAccelerators()
|
||||||
{
|
{
|
||||||
|
@ -311,6 +313,11 @@ void GSPanel::OnResize(wxSizeEvent& event)
|
||||||
|
|
||||||
void GSPanel::OnCloseWindow(wxCloseEvent& evt)
|
void GSPanel::OnCloseWindow(wxCloseEvent& evt)
|
||||||
{
|
{
|
||||||
|
// CoreThread pausing calls MTGS suspend which calls GSPanel close on
|
||||||
|
// the main thread leading to event starvation. This prevents regenerating
|
||||||
|
// a frame handle when the user closes the window, which prevents this race
|
||||||
|
// condition. -- govanify
|
||||||
|
init_gspanel = false;
|
||||||
CoreThread.Suspend();
|
CoreThread.Suspend();
|
||||||
evt.Skip(); // and close it.
|
evt.Skip(); // and close it.
|
||||||
}
|
}
|
||||||
|
@ -565,6 +572,8 @@ GSFrame::GSFrame( const wxString& title)
|
||||||
|
|
||||||
void GSFrame::OnCloseWindow(wxCloseEvent& evt)
|
void GSFrame::OnCloseWindow(wxCloseEvent& evt)
|
||||||
{
|
{
|
||||||
|
// see GSPanel::OnCloseWindow
|
||||||
|
init_gspanel = false;
|
||||||
sApp.OnGsFrameClosed( GetId() );
|
sApp.OnGsFrameClosed( GetId() );
|
||||||
Hide(); // and don't close it.
|
Hide(); // and don't close it.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue