a58bc42ed0
* chore: bump chromium in DEPS to 68d7ef9b31f3f164a967109212e84a8d756cc80f * Update patches * Update location of file_info.h * Update sysroots * chore: bump chromium in DEPS to 47114394b1c8a35438d19da7538142380551a2ce * Update patches * ci: update docker image to pickup new ia32 dep * Skip .info files in dist.zip Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
29 lines
1.3 KiB
Diff
29 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Apthorp <nornagon@nornagon.net>
|
|
Date: Thu, 20 Sep 2018 17:49:24 -0700
|
|
Subject: mas-cgdisplayusesforcetogray.patch
|
|
|
|
Removes usage of the CGDisplayUsesForceToGray private API.
|
|
|
|
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
|
|
index 43b5ae0c4fcbbaa3fc95ed15a9b02289e45c0cff..a743edce57b31b867afbc9676ac9c3e7475e5fe9 100644
|
|
--- a/ui/display/mac/screen_mac.mm
|
|
+++ b/ui/display/mac/screen_mac.mm
|
|
@@ -107,7 +107,17 @@ Display BuildDisplayForScreen(NSScreen* screen) {
|
|
|
|
display.set_color_depth(Display::kDefaultBitsPerPixel);
|
|
display.set_depth_per_component(Display::kDefaultBitsPerComponent);
|
|
+#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
|
|
|
|
if (auto display_link = ui::DisplayLinkMac::GetForDisplay(display_id))
|
|
display.set_display_frequency(display_link->GetRefreshRate());
|