From: Benjamin Williams Date: Wed, 8 Nov 2006 09:54:05 +0000 (+0000) Subject: wxAuiNotebook tab drag-drop bug fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/87e5fe6990549a6133769b49bce910633e3aab0b?ds=inline wxAuiNotebook tab drag-drop bug fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 53f00a42f7..f2ed26ae88 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2728,8 +2728,12 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt) { wxWindow* tab_ctrl = ::wxFindWindowAtPoint(screen_pt); + // if we aren't over any window, stop here + if (!tab_ctrl) + return; + // make sure we are not over the hint window - if (tab_ctrl && !tab_ctrl->IsKindOf(CLASSINFO(wxFrame))) + if (!tab_ctrl->IsKindOf(CLASSINFO(wxFrame))) { while (tab_ctrl) { @@ -2744,12 +2748,20 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt) if (nb != this) { - wxRect hint_rect = tab_ctrl->GetRect(); + wxRect hint_rect = tab_ctrl->GetClientRect(); tab_ctrl->ClientToScreen(&hint_rect.x, &hint_rect.y); m_mgr.ShowHint(hint_rect); return; } - + } + } + else + { + if (!dest_tabs) + { + // we are either over a hint window, or not over a tab + // window, and there is no where to drag to, so exit + return; } } }