Skip to content

fix: propagate preferred color scheme to the renderer (#22896) - #22901

Merged
MarshallOfSound merged 2 commits into
8-x-yfrom
fix-prefers-color-scheme-8
Apr 2, 2020
Merged

MarshallOfSound merged 2 commits into
8-x-yfrom
fix-prefers-color-scheme-8

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Backport of #22896

See that PR for details.

Notes: Fixed issue where prefers-color-scheme would not be updated / set correctly when your OS was in dark mode

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Mar 30, 2020
@trop trop Bot added 8-x-y backport This is a backport PR labels Mar 30, 2020
@MarshallOfSound
MarshallOfSound force-pushed the fix-prefers-color-scheme-8 branch from 7bcb6c8 to 7e2cb0b Compare March 30, 2020 22:46
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Mar 30, 2020
@zcbenz

zcbenz commented Apr 1, 2020

Copy link
Copy Markdown
Contributor

Build is failing

../../electron/shell/browser/electron_browser_client.cc:426:10: error: no member named 'preferred_color_scheme' in 'content::WebPreferences'
  prefs->preferred_color_scheme = native_theme->ShouldUseDarkColors()
  ~~~~~  ^
../../electron/shell/browser/electron_browser_client.cc:427:48: error: no member named 'PreferredColorScheme' in namespace 'blink'
                                      ? blink::PreferredColorScheme::kDark
                                        ~~~~~~~^
../../electron/shell/browser/electron_browser_client.cc:428:48: error: no member named 'PreferredColorScheme' in namespace 'blink'
                                      : blink::PreferredColorScheme::kLight;
                                        ~~~~~~~^
3 errors generated.

* fix: do not crash if the window is closed syncronously with a nativeTheme change

* fix: propogate preferred color scheme to the renderer and keep it up to date
@MarshallOfSound
MarshallOfSound force-pushed the fix-prefers-color-scheme-8 branch from 7e2cb0b to 8a9dd7e Compare April 1, 2020 18:37
@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner April 1, 2020 19:57
@MarshallOfSound
MarshallOfSound force-pushed the fix-prefers-color-scheme-8 branch from 2f0ed44 to 9fa8817 Compare April 1, 2020 23:43
@MarshallOfSound
MarshallOfSound merged commit 3ba4a35 into 8-x-y Apr 2, 2020
@release-clerk

release-clerk Bot commented Apr 2, 2020

Copy link
Copy Markdown

Release Notes Persisted

Fixed issue where prefers-color-scheme would not be updated / set correctly when your OS was in dark mode

@MarshallOfSound
MarshallOfSound deleted the fix-prefers-color-scheme-8 branch April 2, 2020 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8-x-y backport This is a backport PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants