Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
loadNibNamed:owner:topLevelObjects is available on 10.8 and newer.
There is an issue report here about an app failing to function on
10.7 and earlier: https://discourse.libsdl.org/t/28179
  • Loading branch information
sezero committed Oct 9, 2020
1 parent e58cc5f commit 69fbd60
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/video/cocoa/SDL_cocoaevents.m
Expand Up @@ -33,6 +33,9 @@
#ifndef kIOPMAssertPreventUserIdleDisplaySleep
#define kIOPMAssertPreventUserIdleDisplaySleep kIOPMAssertionTypePreventUserIdleDisplaySleep
#endif
#ifndef NSAppKitVersionNumber10_8
#define NSAppKitVersionNumber10_8 1187
#endif

@interface SDLApplication : NSApplication

Expand Down Expand Up @@ -306,7 +309,10 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv
NSDictionary *infoDict;
NSString *mainNibFileName;
bool success = false;


if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_8) {
return false;
}
infoDict = [[NSBundle mainBundle] infoDictionary];
if (infoDict) {
mainNibFileName = [infoDict valueForKey:@"NSMainNibFile"];
Expand Down

0 comments on commit 69fbd60

Please sign in to comment.