Skip to content

Commit

Permalink
Attempt to make version detection safe for Mac OS X < 10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 11, 2020
1 parent 52b410a commit fe8ce66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -1796,8 +1796,10 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
/* Hack to fix origin on Mac OS X 10.4
This is no longer needed as of Mac OS X 10.15, according to bug 4822.
*/
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
if ((version.majorVersion == 10) && (version.minorVersion < 15)) {
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
NSOperatingSystemVersion version = { 10, 15, 0 };
if (![processInfo respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] ||
![processInfo isOperatingSystemAtLeastVersion:version]) {
NSRect screenRect = [[nswindow screen] frame];
if (screenRect.size.height >= 1.0f) {
rect.origin.y += (screenRect.size.height - rect.size.height);
Expand Down

0 comments on commit fe8ce66

Please sign in to comment.