]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/frame.cpp
Should work for wxMSW, now. Cannot test this myself, though.
[wxWidgets.git] / src / mac / frame.cpp
index b370f7b10848343e1cb0f1cc60c026184c61c17d..55f1e3b72c132d90555fbc6622ae329c906f76f5 100644 (file)
@@ -450,7 +450,12 @@ void wxFrame::ProcessCommand(int id)
   }
 */
 
-  GetEventHandler()->ProcessEvent(commandEvent);
+  // Process events starting with the window with the focus, if any.
+  wxWindow* focusWin = wxFindFocusDescendant(this);
+
+  wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler();
+
+  evtHandler->ProcessEvent(commandEvent);
 }
 
 // Checks if there is a toolbar, and returns the first free client position