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.
This commit is contained in:
valid-ptr 2022-05-25 19:58:17 +03:00 committed by Vadim Zeitlin
parent 029b99e9d7
commit e777a82bfd

View File

@ -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