X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6212a0cb7e6285f62198a9411d91bbe8dc06e60..f2a18fbec6f74bcb7957392f6e71982c8ca54568:/src/aui/auibook.cpp diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 690acc096b..cfeaa264a6 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3440,6 +3440,21 @@ void wxAuiNotebook::SetSelectionToWindow(wxWindow *win) const int idx = m_tabs.GetIdxFromWindow(win); wxCHECK_RET( idx != wxNOT_FOUND, _T("invalid notebook page") ); + + // since a tab was clicked, let the parent know that we received + // the focus, even if we will assign that focus immediately + // to the child tab in the SetSelection call below + // (the child focus event will also let wxAuiManager, if any, + // know that the notebook control has been activated) + + wxWindow* parent = GetParent(); + if (parent) + { + wxChildFocusEvent eventFocus(this); + parent->GetEventHandler()->ProcessEvent(eventFocus); + } + + SetSelection(idx); }