From: Stefan Csomor Date: Mon, 3 Oct 2005 09:28:01 +0000 (+0000) Subject: avoid system pop-up menu commands being handled by wxApp, bug was shown in printing... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6e644ef2d35230f9d4a5c0bb89b98edd3e4d6c69 avoid system pop-up menu commands being handled by wxApp, bug was shown in printing, using File->Print and changing Popup from 'Copies & Pages' to eg 'Layout' git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 45a5dea76b..deef92ad8a 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -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 )