Skip to content

Commit

Permalink
Revert changeset 67f391c74aee after the breakage report
Browse files Browse the repository at this point in the history
See: http://bugzilla.libsdl.org/show_bug.cgi?id=4114#c5

Also revert the change from Xcode project templates and
adjust the changelogs.
  • Loading branch information
sezero committed Nov 13, 2019
1 parent eb787c0 commit abf8b26
Show file tree
Hide file tree
Showing 11 changed files with 261 additions and 15 deletions.
2 changes: 0 additions & 2 deletions WhatsNew
Expand Up @@ -55,8 +55,6 @@ Changes include:
- Mac OS X, joystick: update to support Saitek p2500 gamepad (bug 2025)
- Mac OS X, main: updates for -psn_XXX command line arg for Finder
launches in new macOS versions.
- Mac OS X, main: replace deprecated CPS apis in new OSX versions
(bug 4114.)
- Windows, video: fix other window positions/sizes when exiting
fullscreen (bug 3315.)
- Windows, keyboard: reset deadkeys upon SDL_EnableUNICODE() or upon
Expand Down
30 changes: 29 additions & 1 deletion Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m
Expand Up @@ -20,6 +20,22 @@ - (void)setAppleMenu:(NSMenu *)menu;
/* 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;
Expand Down Expand Up @@ -185,7 +201,18 @@ static void CustomApplicationMain (int argc, char **argv)
SDLMain *sdlMain;

/* Ensure the application object is initialised */
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
[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 */

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
Expand Down Expand Up @@ -318,6 +345,7 @@ - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
@end



#ifdef main
# undef main
#endif
Expand Down
30 changes: 29 additions & 1 deletion Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m
Expand Up @@ -20,6 +20,22 @@ - (void)setAppleMenu:(NSMenu *)menu;
/* 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;
Expand Down Expand Up @@ -185,7 +201,18 @@ static void CustomApplicationMain (int argc, char **argv)
SDLMain *sdlMain;

/* Ensure the application object is initialised */
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
[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 */

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
Expand Down Expand Up @@ -318,6 +345,7 @@ - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
@end



#ifdef main
# undef main
#endif
Expand Down
30 changes: 29 additions & 1 deletion Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m
Expand Up @@ -20,6 +20,22 @@ - (void)setAppleMenu:(NSMenu *)menu;
/* 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;
Expand Down Expand Up @@ -185,7 +201,18 @@ static void CustomApplicationMain (int argc, char **argv)
SDLMain *sdlMain;

/* Ensure the application object is initialised */
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
[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 */

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
Expand Down Expand Up @@ -318,6 +345,7 @@ - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
@end



#ifdef main
# undef main
#endif
Expand Down
Expand Up @@ -20,6 +20,22 @@ - (void)setAppleMenu:(NSMenu *)menu;
/* 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;
Expand Down Expand Up @@ -185,7 +201,18 @@ static void CustomApplicationMain (int argc, char **argv)
SDLMain *sdlMain;

/* Ensure the application object is initialised */
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
[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 */

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
Expand Down Expand Up @@ -318,6 +345,7 @@ - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
@end



#ifdef main
# undef main
#endif
Expand Down
Expand Up @@ -20,6 +20,22 @@ - (void)setAppleMenu:(NSMenu *)menu;
/* 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;
Expand Down Expand Up @@ -185,7 +201,18 @@ static void CustomApplicationMain (int argc, char **argv)
SDLMain *sdlMain;

/* Ensure the application object is initialised */
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
[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 */

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
Expand Down Expand Up @@ -318,6 +345,7 @@ - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
@end



#ifdef main
# undef main
#endif
Expand Down
30 changes: 29 additions & 1 deletion Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m
Expand Up @@ -20,6 +20,22 @@ - (void)setAppleMenu:(NSMenu *)menu;
/* 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;
Expand Down Expand Up @@ -185,7 +201,18 @@ static void CustomApplicationMain (int argc, char **argv)
SDLMain *sdlMain;

/* Ensure the application object is initialised */
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
[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 */

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
Expand Down Expand Up @@ -318,6 +345,7 @@ - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
@end



#ifdef main
# undef main
#endif
Expand Down
30 changes: 29 additions & 1 deletion Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m
Expand Up @@ -20,6 +20,22 @@ - (void)setAppleMenu:(NSMenu *)menu;
/* 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;
Expand Down Expand Up @@ -185,7 +201,18 @@ static void CustomApplicationMain (int argc, char **argv)
SDLMain *sdlMain;

/* Ensure the application object is initialised */
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
[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 */

/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
Expand Down Expand Up @@ -318,6 +345,7 @@ - (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
@end



#ifdef main
# undef main
#endif
Expand Down

0 comments on commit abf8b26

Please sign in to comment.