Avoid a hang if we're dragging a tab to a notebook that's a child of the original tab
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3426,6 +3426,17 @@ void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt)
|
||||
int src_idx = evt.GetSelection();
|
||||
wxWindow* src_page = src_tabs->GetWindowFromIdx(src_idx);
|
||||
|
||||
// Check that it's not an impossible parent relationship
|
||||
wxWindow* p = nb;
|
||||
while (p && !p->IsTopLevel())
|
||||
{
|
||||
if (p == src_page)
|
||||
{
|
||||
return;
|
||||
}
|
||||
p = p->GetParent();
|
||||
}
|
||||
|
||||
// get main index of the page
|
||||
int main_idx = m_tabs.GetIdxFromWindow(src_page);
|
||||
|
||||
|
Reference in New Issue
Block a user