diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index df98c33e87..d7f5d5e57b 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2769,11 +2769,12 @@ void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt) nb->m_tabs.InsertPage(page_info.window, page_info, insert_idx); nb->DoSizing(); + dest_tabs->SetActivePage(insert_idx); dest_tabs->DoShowHide(); dest_tabs->Refresh(); // set the selection in the destination tab control - nb->SetSelectionToPage(page_info); + nb->DoModifySelection(insert_idx, false); // notify owner that the tab has been dragged wxAuiNotebookEvent e2(wxEVT_AUINOTEBOOK_DRAG_DONE, m_windowId); @@ -2804,8 +2805,10 @@ void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt) dest_tabs = tab_frame->m_tabs; if (dest_tabs == src_tabs) + { + m_curPage = evt.GetSelection(); return; - + } wxPoint pt = dest_tabs->ScreenToClient(mouse_screen_pt); wxWindow* target = NULL;