electron/patches/chromium/mas-cgdisplayusesforcetogray.patch
Electron Bot 62da00e5c5
chore: bump chromium to 31b4a223e6e2bd9d5ce6c37cbdec6 (master) (#22514)
* chore: bump chromium in DEPS to 7f366dc6e2f06228b12b021cc1486a1de81a257d

* chore: bump chromium in DEPS to d785c1a601f5f33627d23e40b1ed9dd94c63d818

* update patches

* Rename an old referrer policy value

https://chromium-review.googlesource.com/c/chromium/src/+/2082856

* chore: bump chromium in DEPS to 735e0d2910b2e55c15e0b9cb9fca9431307ac661

* update v8 patches

* Update DEPS

* update patches

* chore: bump chromium in DEPS to b3d09c15c4460680b85218b7b0eb0849c5a6e840

* Replace blink::WebCursorInfo with ui::Cursor

https://chromium-review.googlesource.com/c/chromium/src/+/1997138

* chore: bump chromium in DEPS to bf433ad6dcfcaac460512bb45a53d5a2ea5356f9

* chore: bump chromium in DEPS to 38fad190ac908b6977ab271acc82c2fe74f6e85e

* chore: bump chromium in DEPS to aa597178119cb37ab54caeda27b2ef30a2f9a003

* update patches

* DownloadURLParameters: Remove NetworkIsolationKey parameter.

https://chromium-review.googlesource.com/c/chromium/src/+/2050987

* fix pdf viewer tests by binding more mojo things

* chore: bump chromium in DEPS to 08835601be331b4a223e6e2bd9d5ce6c37cbdec6

Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-11 07:15:07 -04:00

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 de5994300fc405fe9e63f11023230f448f6109e9..78b880cd1064dc04fc9cd357d122e52179cdd90c 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -133,7 +133,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());