diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 0a37a469ba..2bc8d0587a 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -1973,8 +1973,11 @@ bool wxAuiNotebook::InsertPage(size_t page_idx, else active_tabctrl->InsertPage(page, info, page_idx); - UpdateTabCtrlHeight(); - DoSizing(); + // Note that we don't need to call DoSizing() if the height has changed, as + // it's already called from UpdateTabCtrlHeight() itself in this case. + if ( !UpdateTabCtrlHeight() ) + DoSizing(); + active_tabctrl->DoShowHide(); // adjust selected index