Author: spitzak
Date: 2007-07-30 21:06:25 -0700 (Mon, 30 Jul 2007)
New Revision: 5937
Log:
These changes appear to allow the OSX code to work on older versions?
I'm not sure what this is, it may be from one of the newsgroup postings,
I hope this is a real fix.


Modified:
   trunk/src/osx/run.cxx

Modified: trunk/src/osx/run.cxx
===================================================================
--- trunk/src/osx/run.cxx       2007-07-24 11:25:53 UTC (rev 5936)
+++ trunk/src/osx/run.cxx       2007-07-31 04:06:25 UTC (rev 5937)
@@ -970,7 +970,6 @@
     //AppendResMenu( GetMenuHandle( 1 ), 'DRVR' );
     //DrawMenuBar();
 
-#if 1
     // bring the application into foreground without a 'CARB' resource
     Boolean same_psn;
     ProcessSerialNumber cur_psn, front_psn;
@@ -995,17 +994,20 @@
       }
 
       if ( !bundle ) {
+       OSErr err = 1;
 #ifdef MAC_OS_X_VERSION_10_3
         // newer supported API
-        if( !TransformProcessType( &cur_psn, 
kProcessTransformToForegroundApplication ) )
+       if (TransformProcessType != NULL)
+         err = TransformProcessType( &cur_psn, 
kProcessTransformToForegroundApplication );
 #else
         // undocumented API
-        if( !CPSEnableForegroundOperation( &cur_psn, 0x03, 0x3C, 0x2C, 0x1103 
) )
+        if (CPSEnableForegroundOperation != NULL)
+         err = CPSEnableForegroundOperation( &cur_psn, 0x03, 0x3C, 0x2C, 
0x1103 );
 #endif
-          SetFrontProcess( &cur_psn );
+       if (err == noErr)
+         SetFrontProcess( &cur_psn );
       }
     }
-#endif
   }
 }
 

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to