Index: src/video/cocoa/cocoa_v.mm =================================================================== --- src/video/cocoa/cocoa_v.mm (revision 17622) +++ src/video/cocoa/cocoa_v.mm (working copy) @@ -170,18 +170,23 @@ static void setupApplication() { - CPSProcessSerNum PSN; + ProcessSerialNumber psn = { 0, kCurrentProcess }; /* Ensure the application object is initialised */ [NSApplication sharedApplication]; /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN) && - !CPSEnableForegroundOperation(&PSN, 0x03, 0x3C, 0x2C, 0x1103) && - !CPSSetFrontProcess(&PSN)) { - [NSApplication sharedApplication]; + OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication); + if( returnCode != 0) { + DEBUG(driver, 0, "Could not change to foreground application. Error %d", returnCode); } - + + /* Become the front process, important when start from the command line. */ + OSErr err = SetFrontProcess (& psn ); + if( err != 0) { + DEBUG(driver, 0, "Could not bring the application to front. Error %d", err); + } + /* Set up the menubar */ [NSApp setMainMenu:[[NSMenu alloc] init]]; setApplicationMenu();