Skip to content

Fix tray on GNOME/Wayland: use libappindicator instead of Gtk.StatusIcon#2

Open
GaimsDevSoftware wants to merge 1 commit into
mainfrom
fix/appindicator-tray
Open

Fix tray on GNOME/Wayland: use libappindicator instead of Gtk.StatusIcon#2
GaimsDevSoftware wants to merge 1 commit into
mainfrom
fix/appindicator-tray

Conversation

@GaimsDevSoftware

Copy link
Copy Markdown
Owner

Problem

"TellyKeys Tray" (tellykeys --start-hidden) appeared to do nothing on GNOME. The tray was built with Gtk.StatusIcon, which is a no-op on GNOME and on Wayland in general. The result: a hidden window plus an invisible icon, so the app looked dead with no way to bring it back.

Fix

  • setup_tray() now prefers a StatusNotifierItem via libappindicator (AyatanaAppIndicator3, falling back to AppIndicator3), which GNOME renders through the AppIndicator extension. Gtk.StatusIcon is kept as a fallback for desktops where it still works.
  • The tray menu (Show / Hide / Power / Vol± / Mute / Quit) is factored into _build_tray_menu() and shared by both paths; the "Show TellyKeys" item is wired up as the indicator's secondary-activate target so a middle-click toggles the window where supported.
  • Packaging: add the runtime dependency — libappindicator-gtk3 (RPM) and gir1.2-ayatanaappindicator3-0.1 | gir1.2-appindicator3-0.1 (deb) — and Recommends the gnome-shell-extension-appindicator so GNOME users actually see the icon.

Verification

Ran the patched build with --start-hidden on Fedora 44 / GNOME 50 (Wayland) and confirmed the item registers with the StatusNotifierWatcher:

:1.310@/org/ayatana/NotificationItem/tellykeys

i.e. the tray icon is live and shown by the AppIndicator extension. No crash; Gtk.StatusIcon fallback path is unchanged for other desktops.

🤖 Generated with Claude Code

The tray relied on Gtk.StatusIcon, which is a no-op on GNOME and on
Wayland generally, so `--tray` / `--start-hidden` produced a hidden
window and an invisible icon (the app looked dead).

Prefer a StatusNotifierItem via libappindicator (AyatanaAppIndicator3,
falling back to AppIndicator3), which GNOME shows through the
AppIndicator extension; keep Gtk.StatusIcon as a fallback for desktops
where it still works. The tray menu is shared between both paths.

Packaging: add libappindicator-gtk3 (RPM) /
gir1.2-ayatanaappindicator3-0.1|gir1.2-appindicator3-0.1 (deb) as a
dependency, and recommend gnome-shell-extension-appindicator on GNOME.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant