diff options
Diffstat (limited to 'src/video/cocoa')
-rw-r--r-- | src/video/cocoa/wnd_quartz.mm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm index c93a1f6fb..795a311bc 100644 --- a/src/video/cocoa/wnd_quartz.mm +++ b/src/video/cocoa/wnd_quartz.mm @@ -110,15 +110,23 @@ static CGColorSpaceRef QZ_GetCorrectColorSpace() static CGColorSpaceRef colorSpace = NULL; if (colorSpace == NULL) { - CMProfileRef sysProfile; - - if (CMGetSystemProfile(&sysProfile) == noErr) { - colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile); - CMCloseProfile(sysProfile); - } else { - colorSpace = CGColorSpaceCreateDeviceRGB(); +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + if (MacOSVersionIsAtLeast(10, 5, 0)) { + colorSpace = CGDisplayCopyColorSpace(CGMainDisplayID()); + } else +#endif + { +#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(HAVE_OSX_1011_SDK) + CMProfileRef sysProfile; + if (CMGetSystemProfile(&sysProfile) == noErr) { + colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile); + CMCloseProfile(sysProfile); + } +#endif } + if (colorSpace == NULL) colorSpace = CGColorSpaceCreateDeviceRGB(); + if (colorSpace == NULL) error("Could not get system colour space. You might need to recalibrate your monitor."); } |