Repository navigation
fix: propagate preferred color scheme to the renderer - #22896
Conversation
| #endif | ||
|
|
||
| ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); | ||
| prefs->preferred_color_scheme = native_theme->ShouldUseDarkColors() |
There was a problem hiding this comment.
Can you use the new pipeline to set the color scheme for renderer process as mentioned in https://chromium-review.googlesource.com/c/chromium/src/+/1845575
|
Why is this PR under |
97d9e50 to
7e63541
Compare
|
@deepak1556 Was quite a bad regression in 8 and it's basically just restoring old code. Can we land this restoration of old logic first and I'll follow up with using the new pipeline thing? |
|
@MarshallOfSound the content layer no longer reads the value from web preferences https://chromium-review.googlesource.com/c/chromium/src/+/1845575/18/content/renderer/render_view_impl.cc , shouldn't we use the api from native theme directly based on the CL ? |
|
@deepak1556 It must or that CL must have been reverted because if I match the changes in that CL it doesn't work and the test fails. With these changes it does work and the test passes. Not entirely sure what's going on but I know this works and it's what we had before. |
deepak1556
left a comment
There was a problem hiding this comment.
yeah it seems to have been reintroduced again in https://chromium-review.googlesource.com/c/chromium/src/+/2079192
LGTM
|
Release Notes Persisted
|
|
I was unable to backport this PR to "8-x-y" cleanly; |
|
I have automatically backported this PR to "9-x-y", please check out #22900 |
* 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 has manually backported this PR to "8-x-y", please check out #22901 |
* 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
* 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
* fix: propagate preferred color scheme to the renderer (#22896) * 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 * chore: update native theme source patch for linux
* 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
Fixes #22846
This regressed in a recent Chromium upgrade:
032552d#diff-8a19e7f384ba27f625eb0e55641ee5feL414-L418
This PR fixes the issue and adds a test to ensure it does not regress by accident in the future. It also fixes a crash that was revealed by the test I wrote. If you close a window as the native theme updates, only possible if you do this with
nativeThemedirectly but fixed it 👍It also updates our
native_themeimplementation to override bothwebandnative_uithemes that Chromium uses. Currently Chromium doesn't use webUI and we opt to use native for everything, but there's no harm overriding and it might help us in the future with edge cases.Notes: Fixed issue where
prefers-color-schemewould not be updated / set correctly when your OS was in dark mode