X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce7fe42e848cc0c9058dae906c3a7bded50681e6..e4d44c92f58959f9a61cacb72daa29443f964cb3:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index c35ba60eb8..c7d1d33bde 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -370,6 +370,7 @@ wxEvent::wxEvent(int theId, wxEventType commandType) m_isCommandEvent = false; m_propagationLevel = wxEVENT_PROPAGATE_NONE; m_wasProcessed = false; + m_willBeProcessedAgain = false; } wxEvent::wxEvent(const wxEvent& src) @@ -384,6 +385,7 @@ wxEvent::wxEvent(const wxEvent& src) , m_skipped(src.m_skipped) , m_isCommandEvent(src.m_isCommandEvent) , m_wasProcessed(false) + , m_willBeProcessedAgain(false) { } @@ -403,6 +405,10 @@ wxEvent& wxEvent::operator=(const wxEvent& src) // don't change m_wasProcessed + // While the original again could be passed to another handler, this one + // isn't going to be processed anywhere else by default. + m_willBeProcessedAgain = false; + return *this; } @@ -1428,6 +1434,12 @@ bool wxEvtHandler::TryAfter(wxEvent& event) if ( GetNextHandler() ) return GetNextHandler()->TryAfter(event); + // If this event is going to be processed in another handler next, don't + // pass it to wxTheApp now, it will be done from TryAfter() of this other + // handler. + if ( event.WillBeProcessedAgain() ) + return false; + #if WXWIN_COMPATIBILITY_2_8 // as above, call the old virtual function for compatibility return TryParent(event);