Repository navigation
Conversation
tray-icon's Linux backend (libayatana-appindicator) needs GTK initialised before the icon is built and the GTK main loop iterated afterwards. capsem-tray did neither, so on Linux it failed at startup and could never show an icon or deliver a menu click. Initialise GTK before building the icon and drain pending GTK events on each pass of the existing loop. Without a display there is no tray to draw, so exit 0 as the tray already does when there is no live service. gtk 0.18 is already in the lock through tray-icon and muda; this only adds the direct edge.
The tray was spawned only on macOS, on the premise that Linux has no system tray. Linux desktops do (StatusNotifierItem), and capsem-tray now runs there, so spawn it on Linux under the same condition as on macOS: after the gateway is ready. On a host with no graphical session the tray exits 0 by itself, and a missing tray binary was already non-fatal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits:
fix(tray):tray-icon's Linux backend (libayatana-appindicator) needs GTK initialised before the icon is built and the GTK main loop iterated afterwards.capsem-traydid neither. It now callsgtk::init()and drains pending GTK events on each pass of the existing loop. Without a display it exits 0, as it already does when there is no live service.fix(service): the service started the tray only on macOS. It now starts it on Linux under the same condition (after the gateway is ready).gtk0.18 is already inCargo.lockthroughtray-iconandmuda; the lock change is one added edge, recorded intests/citadel/cargo_lock_identity.toml.Tests.
cargo test -p capsem-tray(88 pass) andcargo clippy -p capsem-service -p capsem-tray --bins --tests -- -D warningsare clean. There is no new unit test: both changes are platform wiring with no logic to isolate. Verified on Omarchy (Hyprland) with a build of main plus these commits: the service starts the tray, the icon appears, and its menu opens the app. Run with no display, it logs "no graphical session for the tray; exiting 0" and exits 0.Runtime library.
tray-iconloadslibayatana-appindicator3(orlibappindicator3) at run time and panics if neither is installed. The.debdepends on neither (package_runtime_packagesinconfig/gate.toml). On a desktop without one, the tray now starts and panics once intotray.log. From readingspawn_companions, nothing restarts it and the service carries on, but I haven't run that case. I left the dependency list alone. I can addlibayatana-appindicator3-1, or probe for the library and exit 0, if you prefer either.Open question. On a host with no graphical session the service now starts a tray process that immediately exits 0. If you would rather not spawn it at all there, I can gate the spawn on
WAYLAND_DISPLAY/DISPLAYinstead.🤖 Generated with Claude Code