diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index 8667b197..80efaa42 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -2813,5 +2813,12 @@ bool MainFrame::BindControls() panel->SetFrameTitle(); // All OK; activate idle loop panel->SetExtraStyle(panel->GetExtraStyle() | wxWS_EX_PROCESS_IDLE); + + // Re-adjust size now to nudge some sense into Widgets. + panel->AdjustSize(false); + + // Frame initialization is complete. + init_complete_ = true; + return true; } diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 59a3b801..08ca7c3e 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -930,6 +930,9 @@ void MainFrame::OnMenu(wxContextMenuEvent& event) } void MainFrame::OnMove(wxMoveEvent&) { + if (!init_complete_) { + return; + } if (!IsFullScreen() && !IsMaximized()) { const wxPoint window_pos = GetScreenPosition(); OPTION(kGeomWindowX) = window_pos.x; @@ -954,6 +957,9 @@ void MainFrame::OnMoveEnd(wxMoveEvent&) { void MainFrame::OnSize(wxSizeEvent& event) { wxFrame::OnSize(event); + if (!init_complete_) { + return; + } const wxRect window_rect = GetRect(); const wxPoint window_pos = GetScreenPosition(); diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index 85ec2a05..0bf30d47 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -356,6 +356,9 @@ private: JoystickPoller* jpoll = nullptr; // quicker & more accurate than FindFocus() != NULL bool focused; + // One-time toggle to indicate that this object is fully initialized. This + // used to filter events that are sent during initialization. + bool init_complete_ = false; #ifndef NO_LINK const config::OptionsObserver gba_link_observer_; #endif