From 3dee7b756aeda102ddff2ff03ce3ee28a92f17b5 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 8 Jan 2018 01:51:43 +0200 Subject: [PATCH] Delay committing fullscreen until seeing window size change Hopefully gets rid of race condition in fullscreening the emulator. --- src/platform/wxwidgets/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/wxwidgets/mainwindow.cpp b/src/platform/wxwidgets/mainwindow.cpp index d96c2cce..8d318072 100644 --- a/src/platform/wxwidgets/mainwindow.cpp +++ b/src/platform/wxwidgets/mainwindow.cpp @@ -182,6 +182,7 @@ namespace threads::thread* emulation_thread; bool status_updated = false; bool becoming_fullscreen = false; + wxSize current_resolution; settingvar::variable> background_audio(*lsnes_instance.settings, "background-audio", "GUIā€£Enable background audio", true); @@ -934,7 +935,7 @@ void wxwin_mainwindow::panel::on_paint(wxPaintEvent& e) dx = (screen.GetWidth() - tw) / 2; if((signed)th < screen.GetHeight()) dy = (screen.GetHeight() - th) / 2; - if(becoming_fullscreen) { + if(becoming_fullscreen && current_resolution != screen) { //Force panel to fullscreen. SetSize(screen); Move(0, 0); @@ -1863,6 +1864,8 @@ void wxwin_mainwindow::enter_or_leave_fullscreen(bool fs) { CHECK_UI_THREAD; if(fs && !is_fs) { + //Save current resolution, so we can see the change. + current_resolution = main_window->GetSize(); if(spanel_shown) toplevel->Detach(spanel); spanel->Hide();