[BUG] Desktop Linux: theme follows system light/dark one switch behind (still present in 2.26454.0, follow-up to #79995)

Status Open
Reported on v2.1.292
Maintainer reply None cached
Activity 0 comments · opened Oct 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Follow-up to #79995, which was closed by the inactivity bot. The bug is still present in Claude Desktop 2.26454.0 (Electron 44.4.3).

With Appearance = "Match system", the app does not follow the OS light/dark switch while it runs. On KDE Plasma Wayland it is always one switch behind: at the switch to dark it stays light (or turns light), at the switch to light it turns dark. A restart always shows the correct theme.

What I verified on Fedora 44, KDE Plasma 6.7.5 Wayland, xdg-desktop-portal 1.22.1 with the KDE and GTK backends:

  1. The portal is correct and on time. dbus-monitor shows SettingChanged for org.freedesktop.appearance / color-scheme with the right value (1 or 2) at the moment of each switch.
  2. A plain Electron 44.4.3 app (same version as Claude Desktop, nativeTheme.themeSource = 'system', hidden BrowserWindow) shows the same fault. nativeTheme.on('updated') fires at the portal signal, but both nativeTheme.shouldUseDarkColors and matchMedia('(prefers-color-scheme: dark)') in the page return the previous mode, and stay there until the next event. Same result with --gtk-version=4.
  3. Electron reads the GTK theme colors when the signal arrives, before kde-gtk-config has rewritten ~/.config/gtk-3.0/colors.css. A GTK theme reload a few seconds after the switch (gsettings set org.gnome.desktop.interface gtk-theme Adwaita, then back to Breeze) makes Electron fire updated again, now with the correct value. The probe app then follows correctly.

This matches the open upstream bug electron/electron#48736 (runtime theme resolution wrong on KDE Wayland since the Chromium 142 native theme refactor).

What Should Happen?

With "Match system", the app should apply the new theme at once, in both directions, without a restart.

Suggested fix (same as in #79995): on Linux, read org.freedesktop.appearance / color-scheme from the settings portal in the main process and set nativeTheme.themeSource to dark or light from it, instead of trusting nativeTheme with themeSource = 'system'. The portal value is correct and instant on the same bus.

Error Messages/Logs

none

Steps to Reproduce

  1. Start Claude Desktop on KDE Plasma Wayland in light mode, Appearance = "Match system".
  2. Switch to dark: plasma-apply-colorscheme BreezeDark. The app stays light.
  3. Switch to light: plasma-apply-colorscheme BreezeLight. The app turns dark.
  4. Restart the app: correct theme.

Workaround for other users: after each switch, wait about 5 seconds, then run
gsettings set org.gnome.desktop.interface gtk-theme Adwaita; sleep 0.5; gsettings set org.gnome.desktop.interface gtk-theme Breeze

Claude Model

Other

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.292 (Claude Code); Claude Desktop 2.26454.0

Platform

Other

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

Fedora 44, KDE Plasma 6.7.5 (Wayland), Claude Desktop 2.26454.0 (official .deb repackaged as RPM, no changes), Electron 44.4.3, xdg-desktop-portal 1.22.1, xdg-desktop-portal-kde 6.7.5, gtk3 3.24.52. Desktop app UI only, not the CLI.

View original on GitHub ↗