The desktop portal's org.freedesktop.appearance settings on the session bus say whether the system prefers dark (color-scheme 1) and which accent colour it uses, and a flatpak may read them. Bus:Appearance subscribes to SettingChanged and reads the namespace in one ReadAll call, which every portal version has, so a start waits for one answer at most, 2 s; a portal that gave no colour scheme by then — still starting, or not on the bus yet — is asked again when its name has an owner, without waiting, and its answer comes as a change. The canvas gained a dark palette and takes the accent for the avatars, badges, buttons and outgoing bubbles, with the text on it dark or light by the accent's brightness. The app applies the theme to the window at once and keeps it for the next one; --theme dark|light or IMSD_MESSAGES_THEME (the same two values: another is refused on the command line and ignored in the environment) overrides the portal's colour scheme, for benches and desktops without a portal.
17 lines
641 B
C++
17 lines
641 B
C++
// SPDX-License-Identifier: GPL-3.0-only
|
|
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
|
|
|
/*
|
|
ImsdMessages.Bus — the GLib side of imsd-messages: the GDBus client of
|
|
imsd's /net/catcrafts/IMS1 on the system bus (the Messaging interface, and
|
|
the frozen interface's registration signal), the decoding of its
|
|
dictionaries, the desktop notifications, the app's own session-bus name and
|
|
the desktop portal's appearance settings. No window: the executable wires
|
|
this to the UI.
|
|
*/
|
|
export module ImsdMessages.Bus;
|
|
export import :Variant;
|
|
export import :Client;
|
|
export import :Notifier;
|
|
export import :Instance;
|
|
export import :Appearance;
|