summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2007-01-23 10:27:44 +0000
committerMatthias Melcher <fltk@matthiasm.com>2007-01-23 10:27:44 +0000
commit7401cf37bf2ac6c6e6a6c230ff1b52ed8fbe06b8 (patch)
tree74688bbff425af1eaffe0565930661507960e2a7
parent5724b00c9a358ccc7e04921de869adee4f5f807b (diff)
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
-rw-r--r--src/Fl_mac.cxx19
1 files changed, 11 insertions, 8 deletions
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 );
}