Skip to content

Commit

Permalink
Update SDLMain.m fram SDL-1.2 tree.
Browse files Browse the repository at this point in the history
Reverts SDL-1.2 changeset 67f391c74aee after the breakage report
See: https://bugzilla.libsdl.org/show_bug.cgi?id=4114#c5
  • Loading branch information
sezero committed Nov 13, 2019
1 parent 403cd3a commit 1970df7
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion Xcode/showimage/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 1970df7

Please sign in to comment.