From 2a29485779b4e48d1b7581f36ca11d4e1116f383 Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Sun, 14 Jul 2002 13:08:24 +0000 Subject: [PATCH] explicitly raise modal dialogs in case a non modal window was selected to activate the application when a modal dialog is displayed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/app.cpp | 59 ++++++++++++++++++++++++++---------------- src/mac/carbon/app.cpp | 59 ++++++++++++++++++++++++++---------------- 2 files changed, 72 insertions(+), 46 deletions(-) diff --git a/src/mac/app.cpp b/src/mac/app.cpp index f19403201a..3828e3612f 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -107,31 +107,31 @@ pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long re pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ; } -pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ; } -pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ; } -pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ; } -short wxApp::MacHandleAEODoc(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEODoc(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { SysBeep(40) ; ProcessSerialNumber PSN ; @@ -141,17 +141,17 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event , WXEVENTREF reply) return noErr ; } -short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEPDoc(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { return noErr ; } -short wxApp::MacHandleAEOApp(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { return noErr ; } -short wxApp::MacHandleAEQuit(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { wxWindow* win = GetTopWindow() ; if ( win ) @@ -804,7 +804,7 @@ pascal void __wxterminate(void) #endif /* WXMAKINGDLL && !__DARWIN__ */ -int WXDLLEXPORT wxEntryStart( int argc, char *argv[] ) +int WXDLLEXPORT wxEntryStart( int WXUNUSED(argc), char *WXUNUSED(argv)[] ) { return wxApp::Initialize(); } @@ -1296,25 +1296,38 @@ void wxApp::MacSuspend( bool convertClipboard ) node = node->Next(); } - - s_lastMouseDown = 0 ; - if( convertClipboard ) - { - MacConvertPrivateToPublicScrap() ; - } - - ::HideFloatingWindows() ; + + s_lastMouseDown = 0 ; + if( convertClipboard ) + { + MacConvertPrivateToPublicScrap() ; + } + + ::HideFloatingWindows() ; } +extern wxList wxModalDialogs; + void wxApp::MacResume( bool convertClipboard ) { - s_lastMouseDown = 0 ; - if( convertClipboard ) - { - MacConvertPublicToPrivateScrap() ; - } + s_lastMouseDown = 0 ; + if( convertClipboard ) + { + MacConvertPublicToPrivateScrap() ; + } + + ::ShowFloatingWindows() ; + + // raise modal dialogs in case a non modal window was selected to activate the app - ::ShowFloatingWindows() ; + wxNode* node = wxModalDialogs.First(); + while (node) + { + wxDialog* dialog = (wxDialog *) node->Data(); + dialog->Raise(); + + node = node->Next(); + } } void wxApp::MacConvertPrivateToPublicScrap() diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index f19403201a..3828e3612f 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -107,31 +107,31 @@ pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long re pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) ; -pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ; } -pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ; } -pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ; } -pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon ) +pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long WXUNUSED(refcon) ) { // GD: UNUSED wxApp* app = (wxApp*) refcon ; return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ; } -short wxApp::MacHandleAEODoc(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEODoc(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { SysBeep(40) ; ProcessSerialNumber PSN ; @@ -141,17 +141,17 @@ short wxApp::MacHandleAEODoc(const WXEVENTREF event , WXEVENTREF reply) return noErr ; } -short wxApp::MacHandleAEPDoc(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEPDoc(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { return noErr ; } -short wxApp::MacHandleAEOApp(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEOApp(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { return noErr ; } -short wxApp::MacHandleAEQuit(const WXEVENTREF event , WXEVENTREF reply) +short wxApp::MacHandleAEQuit(const WXEVENTREF WXUNUSED(event) , WXEVENTREF WXUNUSED(reply)) { wxWindow* win = GetTopWindow() ; if ( win ) @@ -804,7 +804,7 @@ pascal void __wxterminate(void) #endif /* WXMAKINGDLL && !__DARWIN__ */ -int WXDLLEXPORT wxEntryStart( int argc, char *argv[] ) +int WXDLLEXPORT wxEntryStart( int WXUNUSED(argc), char *WXUNUSED(argv)[] ) { return wxApp::Initialize(); } @@ -1296,25 +1296,38 @@ void wxApp::MacSuspend( bool convertClipboard ) node = node->Next(); } - - s_lastMouseDown = 0 ; - if( convertClipboard ) - { - MacConvertPrivateToPublicScrap() ; - } - - ::HideFloatingWindows() ; + + s_lastMouseDown = 0 ; + if( convertClipboard ) + { + MacConvertPrivateToPublicScrap() ; + } + + ::HideFloatingWindows() ; } +extern wxList wxModalDialogs; + void wxApp::MacResume( bool convertClipboard ) { - s_lastMouseDown = 0 ; - if( convertClipboard ) - { - MacConvertPublicToPrivateScrap() ; - } + s_lastMouseDown = 0 ; + if( convertClipboard ) + { + MacConvertPublicToPrivateScrap() ; + } + + ::ShowFloatingWindows() ; + + // raise modal dialogs in case a non modal window was selected to activate the app - ::ShowFloatingWindows() ; + wxNode* node = wxModalDialogs.First(); + while (node) + { + wxDialog* dialog = (wxDialog *) node->Data(); + dialog->Raise(); + + node = node->Next(); + } } void wxApp::MacConvertPrivateToPublicScrap() -- 2.45.2