2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-14 05:02:16 +00:00
|
|
|
From: Jeremy Apthorp <nornagon@nornagon.net>
|
2018-09-21 00:30:26 +00:00
|
|
|
Date: Thu, 20 Sep 2018 17:49:24 -0700
|
|
|
|
Subject: mas-cgdisplayusesforcetogray.patch
|
2018-09-14 05:02:16 +00:00
|
|
|
|
2018-09-21 00:30:26 +00:00
|
|
|
Removes usage of the CGDisplayUsesForceToGray private API.
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
|
2019-12-11 00:22:35 +00:00
|
|
|
index b19c27fe7ec208e53bbff9c9901f59ba595f68d8..9a4d2df4b32342c19d03f03a83563f0f178ba54c 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/ui/display/mac/screen_mac.mm
|
|
|
|
+++ b/ui/display/mac/screen_mac.mm
|
2019-10-28 22:12:35 +00:00
|
|
|
@@ -116,7 +116,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
|
|
|
|
display.set_depth_per_component(Display::kHDR10BitsPerComponent);
|
|
|
|
}
|
|
|
|
}
|
2018-09-14 05:02:16 +00:00
|
|
|
+#ifdef MAS_BUILD
|
|
|
|
+ // This is equivalent to the CGDisplayUsesForceToGray() API as at 2018-08-06,
|
|
|
|
+ // but avoids usage of the private API.
|
|
|
|
+ CFStringRef app = CFSTR("com.apple.CoreGraphics");
|
|
|
|
+ CFStringRef key = CFSTR("DisplayUseForcedGray");
|
|
|
|
+ Boolean key_valid = false;
|
|
|
|
+ display.set_is_monochrome(
|
|
|
|
+ CFPreferencesGetAppBooleanValue(key, app, &key_valid));
|
|
|
|
+#else
|
|
|
|
display.set_is_monochrome(CGDisplayUsesForceToGray());
|
|
|
|
+#endif
|
|
|
|
|
2019-07-03 01:22:09 +00:00
|
|
|
if (auto display_link = ui::DisplayLinkMac::GetForDisplay(display_id))
|
|
|
|
display.set_display_frequency(display_link->GetRefreshRate());
|