From e777a82bfd79b2b0bef493fc910a64a9893497f0 Mon Sep 17 00:00:00 2001 From: valid-ptr Date: Wed, 25 May 2022 19:58:17 +0300 Subject: [PATCH] Fix AUI floating position mismatch Ensure that the owner idea of the floating frame position always matches reality -- which could be not the case before if we returned before updating it. This commit is best viewed with git --color-moved --color-moved-ws=ignore-all-space options. Closes #22458. --- src/aui/floatpane.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/aui/floatpane.cpp b/src/aui/floatpane.cpp index 2695121ff43f..628626de9da5 100644 --- a/src/aui/floatpane.cpp +++ b/src/aui/floatpane.cpp @@ -203,6 +203,13 @@ void wxAuiFloatingFrame::OnClose(wxCloseEvent& evt) void wxAuiFloatingFrame::OnMoveEvent(wxMoveEvent& event) { + // Always sync pane's floating_pos with frame's position + if (m_ownerMgr) + { + m_ownerMgr->GetPane(m_paneWindow). + floating_pos = event.GetPosition(); + } + if (!m_solidDrag) { // systems without solid window dragging need to be @@ -242,14 +249,6 @@ void wxAuiFloatingFrame::OnMoveEvent(wxMoveEvent& event) m_last2Rect = m_lastRect; m_lastRect = winRect; - // However still update the internally stored position to avoid - // snapping back to the old one later. - if (m_ownerMgr) - { - m_ownerMgr->GetPane(m_paneWindow). - floating_pos = winRect.GetPosition(); - } - return; } #endif