X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69231000be8d209bb8ea1f6aaa1ff665a270e351..eccf1b2c7651b72cce91a83e3f2778e6325a955b:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 061d991d7a..73d7d79ba6 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -943,15 +943,21 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) } #if wxUSE_GUI - // Carry on up the parent-child hierarchy, - // but only if event is a command event: it wouldn't - // make sense for a parent to receive a child's size event, for example + // Carry on up the parent-child hierarchy, but only if event is a command + // event: it wouldn't make sense for a parent to receive a child's size + // event, for example if ( m_isWindow && event.IsCommandEvent() ) { wxWindow *win = (wxWindow *)this; - wxWindow *parent = win->GetParent(); - if (parent && !parent->IsBeingDeleted()) - return parent->GetEventHandler()->ProcessEvent(event); + + // also, don't propagate events beyond the first top level window: it + // doesn't make sense to process dialogs events in the parent frame + if ( !win->IsTopLevel() ) + { + wxWindow *parent = win->GetParent(); + if (parent && !parent->IsBeingDeleted()) + return parent->GetEventHandler()->ProcessEvent(event); + } } #endif // wxUSE_GUI