From 377a219ac700cdf055216541a150a0f25912f373 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 19 Jul 2002 20:13:18 +0000 Subject: [PATCH] Applied patch [ 578052 ] Doc/View and recursion problems git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/docmdi.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp index 78da575af5..5deea0ff65 100644 --- a/src/common/docmdi.cpp +++ b/src/common/docmdi.cpp @@ -105,16 +105,28 @@ wxDocMDIChildFrame::~wxDocMDIChildFrame(void) // Extend event processing to search the view's event table bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event) { + static wxEvent *ActiveEvent = NULL; + + // Break recursion loops + if (ActiveEvent == &event) + return false; + + ActiveEvent = &event; + + bool ret; if ( !m_childView || ! m_childView->ProcessEvent(event) ) { // Only hand up to the parent if it's a menu command if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event)) - return wxEvtHandler::ProcessEvent(event); + ret = wxEvtHandler::ProcessEvent(event); else - return TRUE; + ret = TRUE; } else - return TRUE; + ret = TRUE; + + ActiveEvent = NULL; + return ret; } void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event) -- 2.45.2