Skip to content

Add automatic system tray support to FluxTuner GTK - #219

Merged
pitill0 merged 6 commits into
mainfrom
feature/gtk-tray
Sep 2, 2026
Merged

pitill0 merged 6 commits into
mainfrom
feature/gtk-tray

Conversation

@pitill0

@pitill0 pitill0 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #216.

Adds Linux system tray support to the FluxTuner GTK frontend using
StatusNotifierItem and DBusMenu directly through Gio/D-Bus.

The implementation is isolated from the core playback architecture and does
not introduce an additional runtime dependency.

Behavior

When a compatible Linux StatusNotifierWatcher is available:

  • the FluxTuner tray icon is registered automatically;
  • closing the GTK window hides it instead of terminating FluxTuner;
  • playback continues while the window is hidden;
  • activating the tray icon restores and focuses the window;
  • the tray menu shows the currently playing station;
  • Stop stops playback;
  • Quit explicitly terminates FluxTuner.

If tray registration is unavailable, FluxTuner gracefully keeps the existing
close-window behavior.

Tray icon

The tray uses the FluxTuner application icon through SNI IconPixmap, with
the standard audio-radio icon retained as a fallback.

The application icon is now included as packaged GTK data so it also works
when running directly from the source tree.

Lifecycle

The tray uses GApplication.hold() / release() rather than hidden dummy
windows.

The Linux SNI backend uses its own D-Bus connection so that destroying the
tray notifier cleanly removes it from the desktop without interfering with
GTK's shared application bus.

Scope

This initial implementation is Linux-only.

macOS keeps its existing GTK lifecycle. Native macOS menu-bar support can be
implemented separately later.

The initial menu intentionally remains small:

  • current station
  • Show FluxTuner
  • Stop
  • Quit

Play/pause, volume, favorites and other controls remain possible future
enhancements.

Testing

  • Added StatusNotifierItem / DBusMenu protocol tests.
  • Added tray menu and playback-state coverage.
  • Added packaged icon coverage.
  • Added close-to-tray lifecycle regression coverage.
  • Manually validated on niri with DankMaterialShell:
    • automatic tray registration;
    • custom FluxTuner icon;
    • window hide/restore;
    • playback continuing while hidden;
    • Stop;
    • Quit;
    • correct tray removal/re-registration.

make gate passes cleanly.

@pitill0
pitill0 merged commit 22eefdd into main Sep 2, 2026
6 checks passed
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.

Enhancement: Add system tray support to FluxTuner GTK

1 participant