]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid system pop-up menu commands being handled by wxApp, bug was shown in printing...
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 3 Oct 2005 09:28:01 +0000 (09:28 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 3 Oct 2005 09:28:01 +0000 (09:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/app.cpp

index 45a5dea76b7d42439bb0547e96fdab7e1d80dccb..deef92ad8a2e37fa0a58fd66d664e7a9f31d3a66 100644 (file)
@@ -453,7 +453,15 @@ static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler
     }
     else if ( id != 0 && command.menu.menuRef != 0 && command.menu.menuItemIndex != 0 )
     {
-        GetMenuItemRefCon( command.menu.menuRef , command.menu.menuItemIndex , (UInt32*) &item ) ;
+        wxMenu* itsMenu = NULL ;
+        UInt32 refCon ;
+        GetMenuItemRefCon( command.menu.menuRef , command.menu.menuItemIndex , &refCon ) ;
+        // make sure it is one of our own menus, otherwise don't touch
+        itsMenu = wxFindMenuFromMacMenu( command.menu.menuRef ) ;
+        if ( itsMenu != NULL )
+        {
+            item = (wxMenuItem*) refCon ;
+        }
     }
 
     if ( item )