From d719374cb94f11bffef735afbcfb6833f2b1b721 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 23 Dec 2016 22:08:18 -0400 Subject: [PATCH] Mac: Fix over-saturated colors on P3 displays (e.g. the 2016 MBPs). --- src/video/cocoa/SDL_cocoawindow.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index f705a6c478180..6f60c5920262b 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1276,6 +1276,13 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent [nswindow setContentView:contentView]; [contentView release]; + /* The app's content is likely authored expecting sRGB output. If we don't + * specify the window's color space, it will default to the device color + * space, which will be P3 on capable displays. The mismatch causes the + * content authored in sRGB to appear extremely saturated on the P3 display. + */ + [nswindow setColorSpace:[NSColorSpace sRGBColorSpace]]; + /* Allow files and folders to be dragged onto the window by users */ [nswindow registerForDraggedTypes:[NSArray arrayWithObject:(NSString *)kUTTypeFileURL]];