From 217e740791c66369938ec7b9e7f9ad4f56fd1cd5 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:48:24 -0700 Subject: [PATCH] fix: High Contrast mode not working on Windows (#42859) Closes https://github.com/electron/electron/issues/42609 Refs https://chromium-review.googlesource.com/c/chromium/src/+/5324688 Refs https://chromium-review.googlesource.com/c/chromium/src/+/5368321 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- shell/browser/electron_browser_client.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 3c569a533fe6..849cb3525d6e 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -424,6 +424,7 @@ void ElectronBrowserClient::OverrideWebkitPrefs( renderer_prefs->can_accept_load_drops = false; ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); + prefs->in_forced_colors = native_theme->InForcedColorsMode(); prefs->preferred_color_scheme = native_theme->ShouldUseDarkColors() ? blink::mojom::PreferredColorScheme::kDark