Skip to content

feat: add system tray with native left-click support on Linux#586

Open
joshii-h wants to merge 2 commits into
cinnyapp:mainfrom
joshii-h:feat/system-tray
Open

feat: add system tray with native left-click support on Linux#586
joshii-h wants to merge 2 commits into
cinnyapp:mainfrom
joshii-h:feat/system-tray

Conversation

@joshii-h

@joshii-h joshii-h commented Jun 3, 2026

Copy link
Copy Markdown

What

Restores the system tray and ports it to Tauri v2.

A tray was previously added in #166 (closing the request in #65) and reverted in #312. Per the #312 description, the revert was caused by a Flatpak build failing because of the single instance feature that shipped alongside it — "removing system tray until issues with this are fixed" — i.e. the tray itself was not the problem. This PR brings the tray back on its own (without single instance) and rebuilds it for Tauri v2.

Behaviour

  • Tray icon with a context menu: Show/Hide Cinny and Quit.
  • Close to tray — closing the window hides it instead of quitting; reopen from the icon or menu.
  • Left-click the icon toggles the window.

Platform handling

  • Windows / macOS use Tauri's built-in tray (the tray-icon feature).
  • Linux — Tauri's tray-icon backend uses libayatana-appindicator, whose GTK implementation never forwards a left-click / SNI Activate event to the app; only the context menu works. To provide proper left-click-to-toggle, the StatusNotifierItem is implemented directly with ksni — the same native-SNI approach Qt apps (e.g. Nextcloud) use. The tray-icon feature is scoped to non-Linux desktop targets, which also keeps libappindicator out of the Linux build.

Notes

  • The pre-existing // mod menu; (macOS application menu) is left commented out as before; this PR does not touch it.
  • Tested on Linux / KDE Plasma: tray icon, left-click toggle, context menu and close-to-tray all work.

Restores the system tray (added in cinnyapp#166, reverted in cinnyapp#312) and ports it
to Tauri v2. The cinnyapp#312 revert was a Flatpak/single-instance build issue;
this change adds only the tray and does not reintroduce single instance.

Behaviour:
- Tray icon with a context menu ("Show/Hide Cinny" and "Quit").
- Close-to-tray: closing the window hides it to the tray instead of
  quitting the app; it can be reopened from the tray.
- Left-clicking the icon toggles the window.

Platform handling:
- Windows/macOS use Tauri's built-in tray (the tray-icon feature).
- On Linux, Tauri's tray-icon backend (libayatana-appindicator) does not
  forward left-click/Activate events to the application, so the menu is
  the only interaction. To get proper left-click-to-toggle, the
  StatusNotifierItem is implemented directly via ksni (the approach Qt
  apps such as Nextcloud use). The tray-icon feature is therefore limited
  to non-Linux desktops, which also keeps libappindicator out of the
  Linux build.
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@joshii-h

joshii-h commented Jun 3, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

ajbura added a commit to cinnyapp/cla that referenced this pull request Jun 3, 2026
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