From fe8ce66b53fc26f7db13efee72c85218df367c65 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 11 Feb 2020 10:35:14 -0800 Subject: [PATCH] Attempt to make version detection safe for Mac OS X < 10.10 --- src/video/cocoa/SDL_cocoawindow.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 945cae4b7..959d54550 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1796,8 +1796,10 @@ Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display /* 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);