Revert changeset 67f391c74aee after the breakage report SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Wed, 13 Nov 2019 08:11:10 +0300
branchSDL-1.2
changeset 13239f5a0937d2b04
parent 13227 74055dd839e4
child 13240 da9d34578353
Revert changeset 67f391c74aee after the breakage report

See: http://bugzilla.libsdl.org/show_bug.cgi?id=4114#c5

Also revert the change from Xcode project templates and
adjust the changelogs.
WhatsNew
Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m
Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m
Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m
Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m
Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m
Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m
Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m
Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m
docs.html
src/main/macosx/SDLMain.m
     1.1 --- a/WhatsNew	Thu Oct 31 17:55:00 2019 +0300
     1.2 +++ b/WhatsNew	Wed Nov 13 08:11:10 2019 +0300
     1.3 @@ -55,8 +55,6 @@
     1.4  - Mac OS X, joystick: update to support Saitek p2500 gamepad (bug 2025)
     1.5  - Mac OS X, main: updates for -psn_XXX command line arg for Finder
     1.6    launches in new macOS versions.
     1.7 -- Mac OS X, main: replace deprecated CPS apis in new OSX versions
     1.8 -  (bug 4114.)
     1.9  - Windows, video: fix other window positions/sizes when exiting
    1.10    fullscreen (bug 3315.)
    1.11  - Windows, keyboard: reset deadkeys upon SDL_EnableUNICODE() or upon
     2.1 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     2.2 +++ b/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     2.3 @@ -20,6 +20,22 @@
     2.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     2.5  #define		SDL_USE_NIB_FILE	0
     2.6  
     2.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     2.8 +#define		SDL_USE_CPS		1
     2.9 +#ifdef SDL_USE_CPS
    2.10 +/* Portions of CPS.h */
    2.11 +typedef struct CPSProcessSerNum
    2.12 +{
    2.13 +	UInt32		lo;
    2.14 +	UInt32		hi;
    2.15 +} CPSProcessSerNum;
    2.16 +
    2.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    2.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    2.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    2.20 +
    2.21 +#endif /* SDL_USE_CPS */
    2.22 +
    2.23  static int    gArgc;
    2.24  static char  **gArgv;
    2.25  static BOOL   gFinderLaunch;
    2.26 @@ -185,7 +201,18 @@
    2.27      SDLMain				*sdlMain;
    2.28  
    2.29      /* Ensure the application object is initialised */
    2.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    2.31 +    [NSApplication sharedApplication];
    2.32 +    
    2.33 +#ifdef SDL_USE_CPS
    2.34 +    {
    2.35 +        CPSProcessSerNum PSN;
    2.36 +        /* Tell the dock about us */
    2.37 +        if (!CPSGetCurrentProcess(&PSN))
    2.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    2.39 +                if (!CPSSetFrontProcess(&PSN))
    2.40 +                    [NSApplication sharedApplication];
    2.41 +    }
    2.42 +#endif /* SDL_USE_CPS */
    2.43  
    2.44      /* Set up the menubar */
    2.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    2.46 @@ -318,6 +345,7 @@
    2.47  @end
    2.48  
    2.49  
    2.50 +
    2.51  #ifdef main
    2.52  #  undef main
    2.53  #endif
     3.1 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     3.2 +++ b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     3.3 @@ -20,6 +20,22 @@
     3.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     3.5  #define		SDL_USE_NIB_FILE	0
     3.6  
     3.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     3.8 +#define		SDL_USE_CPS		1
     3.9 +#ifdef SDL_USE_CPS
    3.10 +/* Portions of CPS.h */
    3.11 +typedef struct CPSProcessSerNum
    3.12 +{
    3.13 +	UInt32		lo;
    3.14 +	UInt32		hi;
    3.15 +} CPSProcessSerNum;
    3.16 +
    3.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    3.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    3.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    3.20 +
    3.21 +#endif /* SDL_USE_CPS */
    3.22 +
    3.23  static int    gArgc;
    3.24  static char  **gArgv;
    3.25  static BOOL   gFinderLaunch;
    3.26 @@ -185,7 +201,18 @@
    3.27      SDLMain				*sdlMain;
    3.28  
    3.29      /* Ensure the application object is initialised */
    3.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    3.31 +    [NSApplication sharedApplication];
    3.32 +    
    3.33 +#ifdef SDL_USE_CPS
    3.34 +    {
    3.35 +        CPSProcessSerNum PSN;
    3.36 +        /* Tell the dock about us */
    3.37 +        if (!CPSGetCurrentProcess(&PSN))
    3.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    3.39 +                if (!CPSSetFrontProcess(&PSN))
    3.40 +                    [NSApplication sharedApplication];
    3.41 +    }
    3.42 +#endif /* SDL_USE_CPS */
    3.43  
    3.44      /* Set up the menubar */
    3.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    3.46 @@ -318,6 +345,7 @@
    3.47  @end
    3.48  
    3.49  
    3.50 +
    3.51  #ifdef main
    3.52  #  undef main
    3.53  #endif
     4.1 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     4.2 +++ b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     4.3 @@ -20,6 +20,22 @@
     4.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     4.5  #define		SDL_USE_NIB_FILE	0
     4.6  
     4.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     4.8 +#define		SDL_USE_CPS		1
     4.9 +#ifdef SDL_USE_CPS
    4.10 +/* Portions of CPS.h */
    4.11 +typedef struct CPSProcessSerNum
    4.12 +{
    4.13 +	UInt32		lo;
    4.14 +	UInt32		hi;
    4.15 +} CPSProcessSerNum;
    4.16 +
    4.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    4.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    4.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    4.20 +
    4.21 +#endif /* SDL_USE_CPS */
    4.22 +
    4.23  static int    gArgc;
    4.24  static char  **gArgv;
    4.25  static BOOL   gFinderLaunch;
    4.26 @@ -185,7 +201,18 @@
    4.27      SDLMain				*sdlMain;
    4.28  
    4.29      /* Ensure the application object is initialised */
    4.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    4.31 +    [NSApplication sharedApplication];
    4.32 +    
    4.33 +#ifdef SDL_USE_CPS
    4.34 +    {
    4.35 +        CPSProcessSerNum PSN;
    4.36 +        /* Tell the dock about us */
    4.37 +        if (!CPSGetCurrentProcess(&PSN))
    4.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    4.39 +                if (!CPSSetFrontProcess(&PSN))
    4.40 +                    [NSApplication sharedApplication];
    4.41 +    }
    4.42 +#endif /* SDL_USE_CPS */
    4.43  
    4.44      /* Set up the menubar */
    4.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    4.46 @@ -318,6 +345,7 @@
    4.47  @end
    4.48  
    4.49  
    4.50 +
    4.51  #ifdef main
    4.52  #  undef main
    4.53  #endif
     5.1 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     5.2 +++ b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     5.3 @@ -20,6 +20,22 @@
     5.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     5.5  #define		SDL_USE_NIB_FILE	0
     5.6  
     5.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     5.8 +#define		SDL_USE_CPS		1
     5.9 +#ifdef SDL_USE_CPS
    5.10 +/* Portions of CPS.h */
    5.11 +typedef struct CPSProcessSerNum
    5.12 +{
    5.13 +	UInt32		lo;
    5.14 +	UInt32		hi;
    5.15 +} CPSProcessSerNum;
    5.16 +
    5.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    5.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    5.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    5.20 +
    5.21 +#endif /* SDL_USE_CPS */
    5.22 +
    5.23  static int    gArgc;
    5.24  static char  **gArgv;
    5.25  static BOOL   gFinderLaunch;
    5.26 @@ -185,7 +201,18 @@
    5.27      SDLMain				*sdlMain;
    5.28  
    5.29      /* Ensure the application object is initialised */
    5.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    5.31 +    [NSApplication sharedApplication];
    5.32 +    
    5.33 +#ifdef SDL_USE_CPS
    5.34 +    {
    5.35 +        CPSProcessSerNum PSN;
    5.36 +        /* Tell the dock about us */
    5.37 +        if (!CPSGetCurrentProcess(&PSN))
    5.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    5.39 +                if (!CPSSetFrontProcess(&PSN))
    5.40 +                    [NSApplication sharedApplication];
    5.41 +    }
    5.42 +#endif /* SDL_USE_CPS */
    5.43  
    5.44      /* Set up the menubar */
    5.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    5.46 @@ -318,6 +345,7 @@
    5.47  @end
    5.48  
    5.49  
    5.50 +
    5.51  #ifdef main
    5.52  #  undef main
    5.53  #endif
     6.1 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     6.2 +++ b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     6.3 @@ -20,6 +20,22 @@
     6.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     6.5  #define		SDL_USE_NIB_FILE	0
     6.6  
     6.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     6.8 +#define		SDL_USE_CPS		1
     6.9 +#ifdef SDL_USE_CPS
    6.10 +/* Portions of CPS.h */
    6.11 +typedef struct CPSProcessSerNum
    6.12 +{
    6.13 +	UInt32		lo;
    6.14 +	UInt32		hi;
    6.15 +} CPSProcessSerNum;
    6.16 +
    6.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    6.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    6.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    6.20 +
    6.21 +#endif /* SDL_USE_CPS */
    6.22 +
    6.23  static int    gArgc;
    6.24  static char  **gArgv;
    6.25  static BOOL   gFinderLaunch;
    6.26 @@ -185,7 +201,18 @@
    6.27      SDLMain				*sdlMain;
    6.28  
    6.29      /* Ensure the application object is initialised */
    6.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    6.31 +    [NSApplication sharedApplication];
    6.32 +    
    6.33 +#ifdef SDL_USE_CPS
    6.34 +    {
    6.35 +        CPSProcessSerNum PSN;
    6.36 +        /* Tell the dock about us */
    6.37 +        if (!CPSGetCurrentProcess(&PSN))
    6.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    6.39 +                if (!CPSSetFrontProcess(&PSN))
    6.40 +                    [NSApplication sharedApplication];
    6.41 +    }
    6.42 +#endif /* SDL_USE_CPS */
    6.43  
    6.44      /* Set up the menubar */
    6.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    6.46 @@ -318,6 +345,7 @@
    6.47  @end
    6.48  
    6.49  
    6.50 +
    6.51  #ifdef main
    6.52  #  undef main
    6.53  #endif
     7.1 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     7.2 +++ b/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     7.3 @@ -20,6 +20,22 @@
     7.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     7.5  #define		SDL_USE_NIB_FILE	0
     7.6  
     7.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     7.8 +#define		SDL_USE_CPS		1
     7.9 +#ifdef SDL_USE_CPS
    7.10 +/* Portions of CPS.h */
    7.11 +typedef struct CPSProcessSerNum
    7.12 +{
    7.13 +	UInt32		lo;
    7.14 +	UInt32		hi;
    7.15 +} CPSProcessSerNum;
    7.16 +
    7.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    7.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    7.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    7.20 +
    7.21 +#endif /* SDL_USE_CPS */
    7.22 +
    7.23  static int    gArgc;
    7.24  static char  **gArgv;
    7.25  static BOOL   gFinderLaunch;
    7.26 @@ -185,7 +201,18 @@
    7.27      SDLMain				*sdlMain;
    7.28  
    7.29      /* Ensure the application object is initialised */
    7.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    7.31 +    [NSApplication sharedApplication];
    7.32 +    
    7.33 +#ifdef SDL_USE_CPS
    7.34 +    {
    7.35 +        CPSProcessSerNum PSN;
    7.36 +        /* Tell the dock about us */
    7.37 +        if (!CPSGetCurrentProcess(&PSN))
    7.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    7.39 +                if (!CPSSetFrontProcess(&PSN))
    7.40 +                    [NSApplication sharedApplication];
    7.41 +    }
    7.42 +#endif /* SDL_USE_CPS */
    7.43  
    7.44      /* Set up the menubar */
    7.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    7.46 @@ -318,6 +345,7 @@
    7.47  @end
    7.48  
    7.49  
    7.50 +
    7.51  #ifdef main
    7.52  #  undef main
    7.53  #endif
     8.1 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     8.2 +++ b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     8.3 @@ -20,6 +20,22 @@
     8.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     8.5  #define		SDL_USE_NIB_FILE	0
     8.6  
     8.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     8.8 +#define		SDL_USE_CPS		1
     8.9 +#ifdef SDL_USE_CPS
    8.10 +/* Portions of CPS.h */
    8.11 +typedef struct CPSProcessSerNum
    8.12 +{
    8.13 +	UInt32		lo;
    8.14 +	UInt32		hi;
    8.15 +} CPSProcessSerNum;
    8.16 +
    8.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    8.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    8.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    8.20 +
    8.21 +#endif /* SDL_USE_CPS */
    8.22 +
    8.23  static int    gArgc;
    8.24  static char  **gArgv;
    8.25  static BOOL   gFinderLaunch;
    8.26 @@ -185,7 +201,18 @@
    8.27      SDLMain				*sdlMain;
    8.28  
    8.29      /* Ensure the application object is initialised */
    8.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    8.31 +    [NSApplication sharedApplication];
    8.32 +    
    8.33 +#ifdef SDL_USE_CPS
    8.34 +    {
    8.35 +        CPSProcessSerNum PSN;
    8.36 +        /* Tell the dock about us */
    8.37 +        if (!CPSGetCurrentProcess(&PSN))
    8.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    8.39 +                if (!CPSSetFrontProcess(&PSN))
    8.40 +                    [NSApplication sharedApplication];
    8.41 +    }
    8.42 +#endif /* SDL_USE_CPS */
    8.43  
    8.44      /* Set up the menubar */
    8.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    8.46 @@ -318,6 +345,7 @@
    8.47  @end
    8.48  
    8.49  
    8.50 +
    8.51  #ifdef main
    8.52  #  undef main
    8.53  #endif
     9.1 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
     9.2 +++ b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
     9.3 @@ -20,6 +20,22 @@
     9.4  /* Use this flag to determine whether we use SDLMain.nib or not */
     9.5  #define		SDL_USE_NIB_FILE	0
     9.6  
     9.7 +/* Use this flag to determine whether we use CPS (docking) or not */
     9.8 +#define		SDL_USE_CPS		1
     9.9 +#ifdef SDL_USE_CPS
    9.10 +/* Portions of CPS.h */
    9.11 +typedef struct CPSProcessSerNum
    9.12 +{
    9.13 +	UInt32		lo;
    9.14 +	UInt32		hi;
    9.15 +} CPSProcessSerNum;
    9.16 +
    9.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
    9.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
    9.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
    9.20 +
    9.21 +#endif /* SDL_USE_CPS */
    9.22 +
    9.23  static int    gArgc;
    9.24  static char  **gArgv;
    9.25  static BOOL   gFinderLaunch;
    9.26 @@ -185,7 +201,18 @@
    9.27      SDLMain				*sdlMain;
    9.28  
    9.29      /* Ensure the application object is initialised */
    9.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
    9.31 +    [NSApplication sharedApplication];
    9.32 +    
    9.33 +#ifdef SDL_USE_CPS
    9.34 +    {
    9.35 +        CPSProcessSerNum PSN;
    9.36 +        /* Tell the dock about us */
    9.37 +        if (!CPSGetCurrentProcess(&PSN))
    9.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
    9.39 +                if (!CPSSetFrontProcess(&PSN))
    9.40 +                    [NSApplication sharedApplication];
    9.41 +    }
    9.42 +#endif /* SDL_USE_CPS */
    9.43  
    9.44      /* Set up the menubar */
    9.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
    9.46 @@ -318,6 +345,7 @@
    9.47  @end
    9.48  
    9.49  
    9.50 +
    9.51  #ifdef main
    9.52  #  undef main
    9.53  #endif
    10.1 --- a/docs.html	Thu Oct 31 17:55:00 2019 +0300
    10.2 +++ b/docs.html	Wed Nov 13 08:11:10 2019 +0300
    10.3 @@ -134,10 +134,6 @@
    10.4    launches in new macOS versions.
    10.5  </P>
    10.6  <P>
    10.7 -  Mac OS X, main: replace deprecated CPS apis in new OSX versions
    10.8 -  (bug <a href="https://bugzilla.libsdl.org/show_bug.cgi?id=4114">4114</a>.)
    10.9 -</P>
   10.10 -<P>
   10.11    Windows, video: fix other window positions/sizes when exiting
   10.12    fullscreen (bug <a href="https://bugzilla.libsdl.org/show_bug.cgi?id=3315">3315</a>.)
   10.13  </P>
    11.1 --- a/src/main/macosx/SDLMain.m	Thu Oct 31 17:55:00 2019 +0300
    11.2 +++ b/src/main/macosx/SDLMain.m	Wed Nov 13 08:11:10 2019 +0300
    11.3 @@ -20,6 +20,22 @@
    11.4  /* Use this flag to determine whether we use SDLMain.nib or not */
    11.5  #define		SDL_USE_NIB_FILE	0
    11.6  
    11.7 +/* Use this flag to determine whether we use CPS (docking) or not */
    11.8 +#define		SDL_USE_CPS		1
    11.9 +#ifdef SDL_USE_CPS
   11.10 +/* Portions of CPS.h */
   11.11 +typedef struct CPSProcessSerNum
   11.12 +{
   11.13 +	UInt32		lo;
   11.14 +	UInt32		hi;
   11.15 +} CPSProcessSerNum;
   11.16 +
   11.17 +extern OSErr	CPSGetCurrentProcess( CPSProcessSerNum *psn);
   11.18 +extern OSErr 	CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
   11.19 +extern OSErr	CPSSetFrontProcess( CPSProcessSerNum *psn);
   11.20 +
   11.21 +#endif /* SDL_USE_CPS */
   11.22 +
   11.23  static int    gArgc;
   11.24  static char  **gArgv;
   11.25  static BOOL   gFinderLaunch;
   11.26 @@ -185,7 +201,18 @@
   11.27      SDLMain				*sdlMain;
   11.28  
   11.29      /* Ensure the application object is initialised */
   11.30 -    [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
   11.31 +    [NSApplication sharedApplication];
   11.32 +    
   11.33 +#ifdef SDL_USE_CPS
   11.34 +    {
   11.35 +        CPSProcessSerNum PSN;
   11.36 +        /* Tell the dock about us */
   11.37 +        if (!CPSGetCurrentProcess(&PSN))
   11.38 +            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
   11.39 +                if (!CPSSetFrontProcess(&PSN))
   11.40 +                    [NSApplication sharedApplication];
   11.41 +    }
   11.42 +#endif /* SDL_USE_CPS */
   11.43  
   11.44      /* Set up the menubar */
   11.45      [NSApp setMainMenu:[[NSMenu alloc] init]];
   11.46 @@ -318,6 +345,7 @@
   11.47  @end
   11.48  
   11.49  
   11.50 +
   11.51  #ifdef main
   11.52  #  undef main
   11.53  #endif