fix: High Contrast mode not working on Windows (#42858)

Closes https://github.com/electron/electron/issues/42609
Refs 5324688
Refs 5368321

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-07-10 16:48:41 -07:00 committed by GitHub
parent 474c4b43db
commit 6631dd16ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -424,6 +424,7 @@ void ElectronBrowserClient::OverrideWebkitPrefs(
renderer_prefs->can_accept_load_drops = false; renderer_prefs->can_accept_load_drops = false;
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
prefs->in_forced_colors = native_theme->InForcedColorsMode();
prefs->preferred_color_scheme = prefs->preferred_color_scheme =
native_theme->ShouldUseDarkColors() native_theme->ShouldUseDarkColors()
? blink::mojom::PreferredColorScheme::kDark ? blink::mojom::PreferredColorScheme::kDark