Skip to content

Commit

Permalink
Fix AUI floating position mismatch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
valid-ptr authored and vadz committed May 27, 2022
1 parent 029b99e commit e777a82
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/aui/floatpane.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e777a82

Please sign in to comment.