Chrome follows the Dark mode switch: Chandra serves the portal's color-scheme
CI / test (push) Failing after 17s
CI / test (push) Failing after 17s
Chrome (and Firefox, Electron, GTK 4, Qt 6) read dark/light from xdg-desktop-portal's Settings
interface. With XDG_CURRENT_DESKTOP=chandra and no chandra-portals.conf, xdg-desktop-portal found
no Settings backend (gtk/gnome are UseIn=gnome, kde is UseIn=KDE) and exported no Settings
interface at all, so the gsettings color-scheme a790901 sets never reached Chrome.
- compositor/portal: the compositor is an org.freedesktop.impl.portal.Settings backend
(org.freedesktop.impl.portal.desktop.chandra on the session bus): Read/ReadAll of
org.freedesktop.appearance color-scheme (1 dark, 2 light), SettingChanged when the switch flips,
version property, introspection. Login session only; the main loop wakes on its socket.
- compositor/network/dbus.mbt: serve calls (on_call, reply, reply_error), emit and receive
signals, sender field, session bus address.
- session/chandra.portal + chandra-portals.conf, installed to /usr/share/xdg-desktop-portal by
install.py: Settings from chandra first, then gtk/kde/gnome; other portals from gtk/kde/gnome.
- chandra-session restarts a running xdg-desktop-portal so it reads the config for this desktop.
- scripts/test-portal-dbus.sh: end to end behind the real xdg-desktop-portal on a private bus
(ReadOne gives 1, flipping gives SettingChanged 2). docs/dark-mode.md: how to check it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhkztRQM7vcSuHX4bB
This commit is contained in:
14 files changed
+739
-5
No files matched your search
@@ -24,6 +24,8 @@ Installs:
|
||||
/usr/local/share/chandra/{config,wit,assets}/ files the compositor reads at runtime
|
||||
/usr/local/share/chandra/modules/*.wasm the panel's wasm modules (build them first: just modules)
|
||||
/usr/share/wayland-sessions/chandra.desktop display-manager entry
|
||||
/usr/share/xdg-desktop-portal/portals/chandra.portal xdg-desktop-portal backend: the compositor
|
||||
/usr/share/xdg-desktop-portal/chandra-portals.conf serves Settings (apps' dark/light preference)
|
||||
"""
|
||||
import os, shutil, sys
|
||||
|
||||
@@ -44,6 +46,8 @@ targets = [
|
||||
"/usr/local/bin/chandra-session",
|
||||
"/usr/local/bin/chandra-root",
|
||||
"/usr/share/wayland-sessions/chandra.desktop",
|
||||
"/usr/share/xdg-desktop-portal/portals/chandra.portal",
|
||||
"/usr/share/xdg-desktop-portal/chandra-portals.conf",
|
||||
]
|
||||
|
||||
if os.geteuid() != 0:
|
||||
@@ -104,6 +108,12 @@ install(os.path.join(root, "session/chandra-session"), "/usr/local/bin/chandra-s
|
||||
install(os.path.join(root, "session/chandra-root"), "/usr/local/bin/chandra-root")
|
||||
# The display-manager entry stays a real file: some managers don't follow symlinks there.
|
||||
put(os.path.join(root, "session/chandra.desktop"), "/usr/share/wayland-sessions/chandra.desktop", 0o644)
|
||||
# xdg-desktop-portal reads backends only from /usr/share (or $XDG_DESKTOP_PORTAL_DIR), not
|
||||
# /usr/local. With XDG_CURRENT_DESKTOP=chandra and no chandra-portals.conf it offered apps no
|
||||
# Settings portal at all, so Chrome, Firefox, GTK 4 and Qt 6 never saw the Dark mode switch; the
|
||||
# compositor serves it (compositor/portal) and this config picks it, then the installed backends.
|
||||
put(os.path.join(root, "session/chandra.portal"), "/usr/share/xdg-desktop-portal/portals/chandra.portal", 0o644)
|
||||
put(os.path.join(root, "session/chandra-portals.conf"), "/usr/share/xdg-desktop-portal/chandra-portals.conf", 0o644)
|
||||
# Read at runtime relative to the working directory (the launcher cd's here): the Interface Explorer
|
||||
# shows wit/, the theme comes from config/, and assets/fonts holds the Allo font.
|
||||
for d in ("config", "wit", "assets"):
|
||||
|
||||
Reference in new issue
Block a user