diff --git a/docs/doxygen/overviews/eventhandling.h b/docs/doxygen/overviews/eventhandling.h
index 9618a50ee0..80cc860fe1 100644
--- a/docs/doxygen/overviews/eventhandling.h
+++ b/docs/doxygen/overviews/eventhandling.h
@@ -332,17 +332,21 @@ doesn't count as having handled the event and the search continues):
The event is passed to the next event handler, if any, in the event handler
- chain. This chain can be formed using wxEvtHandler::SetNextHandler() or
- wxWindow::PushEventHandler() but usually there is no next event handler and
- chaining event handlers using these functions is much less useful now that
- Connect() exists so this step will almost never do anything.
+ chain, i.e. the steps (1) to (4) are done for it. This chain can be formed
+ using wxEvtHandler::SetNextHandler() or wxWindow::PushEventHandler() but
+ usually there is no next event handler and chaining event handlers using
+ these functions is much less useful now that Connect() exists so this step
+ will almost never do anything.
- If the object is a wxWindow and the event is set to set to propagate (by
- default only wxCommandEvent-derived events are set to propagate), then the
+ If the object is a wxWindow and the event is set to propagate (by default
+ only wxCommandEvent-derived events are set to propagate), then the
processing restarts from the step (1) (and excluding the step (7)) for the
- parent window.
+ parent window. If this object is not a window but the next handler exists,
+ the event is passed to its parent if it is a window. This ensures that in a
+ common case of (possibly several) non-window event handlers pushed on top
+ of a window, the event eventually reaches the window parent.
diff --git a/src/common/event.cpp b/src/common/event.cpp
index 6c504bc51c..d05742d1fd 100644
--- a/src/common/event.cpp
+++ b/src/common/event.cpp
@@ -1273,6 +1273,13 @@ wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase& entry,
bool wxEvtHandler::TryParent(wxEvent& event)
{
+ if ( GetNextHandler() )
+ {
+ // the next handler will pass it to wxTheApp if it doesn't process it,
+ // so return from here to avoid doing it again
+ return GetNextHandler()->TryParent(event);
+ }
+
if ( wxTheApp && (this != wxTheApp) )
{
// Special case: don't pass wxEVT_IDLE to wxApp, since it'll always