# HG changeset patch # User Ozkan Sezer # Date 1521925975 -10800 # Branch SDL-1.2 # Node ID 205d7b1bee14d653aabecc2cdba9cd193041abdb # Parent b9b9013543a46221c8dcb9acdb1113624da54a5f SDLMain.m: replace CPS* stuff with activateIgnoringOtherApps. CPS stuff are deprecated and emit warnings at runtime, e.g.: warning: CPSGetCurrentProcess(): This call is deprecated and should not be called anymore warning: CPSSetForegroundOperationState() (as above) warning: capture_display; Captured mirror master 0x350000c1 (unit 1) on behalf of slave 0x042716c0 (unit 0) http://lists.libsdl.org/pipermail/sdl-libsdl.org/2006-April/055749.html suggests doing something like: ProcessSerialNumber psn = { 0, kCurrentProcess}; TransformProcessType (&psn, kProcessTransformToForegroundApplication); SetFrontProcess (&psn); And SetFrontProcess() is deprecated in 10.9. Processes.h suggests [[NSApplication sharedApplication] activateIgnoringOtherApps: YES] to make one's own application frontmost. diff --git a/src/main/macosx/SDLMain.m b/src/main/macosx/SDLMain.m --- a/src/main/macosx/SDLMain.m +++ b/src/main/macosx/SDLMain.m @@ -20,22 +20,6 @@ /* Use this flag to determine whether we use SDLMain.nib or not */ #define SDL_USE_NIB_FILE 0 -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - static int gArgc; static char **gArgv; static BOOL gFinderLaunch; @@ -201,18 +185,7 @@ SDLMain *sdlMain; /* Ensure the application object is initialised */ - [NSApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [NSApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ + [[NSApplication sharedApplication] activateIgnoringOtherApps: YES]; /* Set up the menubar */ [NSApp setMainMenu:[[NSMenu alloc] init]]; @@ -345,7 +318,6 @@ @end - #ifdef main # undef main #endif