X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ca6a5f04692678cd2d9f3ea0843fc3f5a0b254f..03e11df5470fd64d9d9a669d0b50b84c2d714736:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index c7678d5b5f..3cc2dff527 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -427,18 +427,23 @@ void wxFrameBase::DoMenuUpdates() { wxMenuBar* bar = GetMenuBar(); +#ifdef __WXMSW__ + wxWindow* focusWin = wxFindFocusDescendant((wxWindow*) this); +#else + wxWindow* focusWin = (wxWindow*) NULL; +#endif if ( bar != NULL ) { int nCount = bar->GetMenuCount(); for (int n = 0; n < nCount; n++) - DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL); + DoMenuUpdates(bar->GetMenu(n), focusWin); } } // update a menu and all submenus recursively -void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin)) +void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* focusWin) { - wxEvtHandler* evtHandler = GetEventHandler(); + wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler(); wxMenuItemList::Node* node = menu->GetMenuItems().GetFirst(); while (node) {