X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f65a5e1aa7e69de4ab41b62085a7419d58b52d9..9c34a216817028bc533e07873d047208a96b05a2:/include/wx/mdi.h diff --git a/include/wx/mdi.h b/include/wx/mdi.h index 78c2f4c3e4..52cbed7da4 100644 --- a/include/wx/mdi.h +++ b/include/wx/mdi.h @@ -381,8 +381,18 @@ inline bool wxMDIParentFrameBase::TryBefore(wxEvent& event) event.GetEventType() == wxEVT_UPDATE_UI ) { wxMDIChildFrame * const child = GetActiveChild(); - if ( child && child->ProcessWindowEventLocally(event) ) - return true; + if ( child ) + { + // However avoid sending the event back to the child if it's + // currently being propagated to us from it. + wxWindow* const + from = static_cast(event.GetPropagatedFrom()); + if ( !from || !from->IsDescendant(child) ) + { + if ( child->ProcessWindowEventLocally(event) ) + return true; + } + } } return wxFrame::TryBefore(event);