]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/mdi.h
No changes, just fix a typo in a comment in docview event handling code.
[wxWidgets.git] / include / wx / mdi.h
index 78c2f4c3e47c65f37a05dc153684dd0dcfe38310..837c132822a7be2cf5145a338b9d062fb1fae772 100644 (file)
@@ -5,7 +5,6 @@
 //              Vadim Zeitlin (base MDI classes refactoring)
 // Copyright:   (c) 1998 Julian Smart
 //              (c) 2008 Vadim Zeitlin
-// RCS-ID:      $Id$
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -381,8 +380,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<wxWindow*>(event.GetPropagatedFrom());
+            if ( !from || !from->IsDescendant(child) )
+            {
+                if ( child->ProcessWindowEventLocally(event) )
+                    return true;
+            }
+        }
     }
 
     return wxFrame::TryBefore(event);