diff --git a/include/wx/mac/carbon/app.h b/include/wx/mac/carbon/app.h index 168ae5c73c..c6e85e926a 100644 --- a/include/wx/mac/carbon/app.h +++ b/include/wx/mac/carbon/app.h @@ -127,6 +127,11 @@ public: // in response of a reopen-application apple event virtual void MacReopenApp() ; +#if wxABI_VERSION >= 20808 + // Hide the application windows the same as the system hide command would do it. + void MacHideApp(); +#endif + DECLARE_EVENT_TABLE() }; diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 47a2e64f87..1b8f575369 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -1677,3 +1677,14 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess event.SetTimestamp(when); event.SetEventObject(focus); } + + +void wxApp::MacHideApp() +{ + wxMacCarbonEvent event( kEventClassCommand , kEventCommandProcess ); + HICommand command; + memset( &command, 0 , sizeof(command) ); + command.commandID = kHICommandHide ; + event.SetParameter(kEventParamDirectObject, command ); + SendEventToApplication( event ); +} diff --git a/version-script.in b/version-script.in index f9a3e04a19..fbf32c4e78 100644 --- a/version-script.in +++ b/version-script.in @@ -27,6 +27,7 @@ # public symbols added in 2.8.8 (please keep in alphabetical order): @WX_VERSION_TAG@.8 { global: + *wxApp*MacHideApp*; *TimeZone*Make*; *wxRemotelyScrolledTreeCtrl*DoCalcScrolledPosition*; *wxRemotelyScrolledTreeCtrl*SetScrollbar*;