From cb542c404634ec090f28c32be968ad6cc056abee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 May 2011 14:17:55 +0000 Subject: [PATCH] Take the AUI floating title bar height into account when dragging it. The cursor wasn't positioned correctly when a floating toolbar was dragged by pressing the mouse over its gripper because its position didn't take into account the difference between the client and window coordinates of the floating window (which is basically the height of the window title bar). Notice that the same problem still remains when starting to drag a docked toolbar as it doesn't have the title bar initially but does have it later so the same fix should probably be applied when we reparent the toolbar. Closes #9984. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/framemanager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 40a3a14..4c0ca6c 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -3429,6 +3429,15 @@ void wxAuiManager::StartPaneDrag(wxWindow* pane_window, m_action_window = pane_window; m_action_offset = offset; m_frame->CaptureMouse(); + + if (pane.frame) + { + wxRect window_rect = pane.frame->GetRect(); + wxRect client_rect = pane.frame->GetClientRect(); + wxPoint client_pt = pane.frame->ClientToScreen(client_rect.GetTopLeft()); + wxPoint origin_pt = client_pt - window_rect.GetTopLeft(); + m_action_offset += origin_pt; + } } -- 2.7.4