From 7401cf37bf2ac6c6e6a6c230ff1b52ed8fbe06b8 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 23 Jan 2007 10:27:44 +0000 Subject: Hopefully some improvement to the 'bring to the foreground'-hack. Please folks, test this on every available platform! git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5634 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_mac.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index 248f181f6..153867b9a 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -1267,12 +1267,19 @@ void fl_open_callback(void (*cb)(const char *)) { * initialize the Mac toolboxes, dock status, and set the default menubar */ -#ifndef MAC_OS_X_VERSION_10_3 extern "C" { -extern OSErr CPSEnableForegroundOperation(ProcessSerialNumber *psn, UInt32 _arg2, + extern OSErr CPSEnableForegroundOperation(ProcessSerialNumber *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -} +#ifndef MAC_OS_X_VERSION_10_3 + enum { + kProcessTransformToForegroundApplication = 1L + }; + typedef UInt32 ProcessApplicationTransformState; + extern OSStatus TransformProcessType(const ProcessSerialNumber *psn, + ProcessApplicationTransformState transformState); #endif +} +//#endif void fl_open_display() { static char beenHereDoneThat = 0; @@ -1319,15 +1326,11 @@ void fl_open_display() { if( !bundle ) { OSErr err = 1; -#ifdef MAC_OS_X_VERSION_10_3 if (TransformProcessType != NULL) { err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication); - } -#else - if (CPSEnableForegroundOperation != NULL) { + } else if (CPSEnableForegroundOperation != NULL) { err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103); } -#endif if (err == noErr) { SetFrontProcess( &cur_psn ); } -- cgit v1.2.3