Watch for OS theme changes at runtime
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-10-21 14:38:40 +07:00
parent 36e5a18982
commit d223879a2e
5 changed files with 90 additions and 27 deletions
+8 -6
View File
@@ -169,11 +169,14 @@ and overwriting them fights its observer.
- `Theme::change(mode, None, cx)` reproduces the native palette for the mode
because the connector installed a `ThemeConfig` per variant.
Known gap (not addressed here): gpui-component's system-appearance follow is
driven by window-activation events. A live OS theme change while the window
is focused may not propagate on Linux until the window is re-focused;
native-theme's `watch` feature (a theme-change watcher) is a possible
follow-up, out of scope.
Known gap (addressed since): gpui-component's system-appearance follow is
driven by window-activation events. The app now enables native-theme's
`watch` feature and re-applies the theme on its signal (`start_theme_watcher`
in `desktop/src/main.rs`), so live OS changes apply without re-focusing or
restarting. macOS reports appearance changes only (`AppleInterfaceTheme-
ChangedNotification`); an accent-only change posts a different notification
the watcher does not observe yet — Windows (`UISettings::ColorValuesChanged`),
KDE (inotify on `kdeglobals`) and GNOME (portal `SettingChanged`) cover accent.
### 4.4 Settings dialog (`settings_dialog.rs`)
@@ -278,6 +281,5 @@ Unchanged:
SVG assets.
- theme-drawn widgets (`widgets` feature).
- a preset-picker UI (`from_preset`) in settings.
- runtime OS-theme watching (`watch` feature).
- per-field user overrides layered on the native theme.
- migrating `signed.json` into a native-theme `Theme` definition.