diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index 78c88abc..8e3c01d2 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -1046,9 +1046,9 @@ void GameArea::OnIdle(wxIdleEvent& event) // On windows with the vcpkg version of wxWidgets which is 3.1.2, the // wxEXPAND flag throws an XRC error, but it is necessary on earlier versions of wxWidgets #if defined(__WXMSW__) && wxCHECK_VERSION(3, 1, 2) - GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER_HORIZONTAL) : wxEXPAND); + GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER) : wxEXPAND); #else - GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER_HORIZONTAL | wxEXPAND) : wxEXPAND); + GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER | wxEXPAND) : wxEXPAND); #endif #if wxCHECK_VERSION(2, 9, 0) @@ -1056,6 +1056,8 @@ void GameArea::OnIdle(wxIdleEvent& event) #endif Layout(); + SendSizeEvent(); + if (pointer_blanked) w->SetCursor(wxCursor(wxCURSOR_BLANK)); diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 64e2b881..74b239df 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -763,22 +763,23 @@ void MainFrame::OnMenu(wxContextMenuEvent& event) void MainFrame::OnMove(wxMoveEvent& event) { (void)event; // unused params - wxRect pos = GetRect(); - int x = pos.GetX(), y = pos.GetY(); + wxPoint pos = GetScreenPosition(); + int x = pos.x, y = pos.y; if (x >= 0 && y >= 0 && !IsFullScreen()) { windowPositionX = x; windowPositionY = y; - update_opts(); } + update_opts(); } void MainFrame::OnSize(wxSizeEvent& event) { wxFrame::OnSize(event); wxRect pos = GetRect(); + wxPoint windowPos = GetScreenPosition(); int height = pos.GetHeight(), width = pos.GetWidth(); - int x = pos.GetX(), y = pos.GetY(); + int x = windowPos.x, y = windowPos.y; bool isFullscreen = IsFullScreen(); if (height > 0 && width > 0 && !isFullscreen) {