mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-06 03:18:23 +00:00
AWT's SystemTray speaks only the legacy XEmbed protocol, which Wayland compositors (Hyprland, Sway, GNOME/KDE Wayland) don't provide, so no tray icon appeared and "close to tray" quit the app instead of minimizing. Add the dorkbox SystemTray library and route the tray through it on Linux (NativeTray.kt): it publishes a freedesktop StatusNotifierItem / AppIndicator, which waybar and the desktop shells host, so the icon and its Open / Lock now / Quit menu now show on Wayland as well as X11. Windows/macOS keep the existing AWT/Compose Tray. Window visibility moves to a MutableStateFlow so the tray's menu callbacks (which fire on the library's own thread) can toggle it safely. Tray creation is fully guarded and returns null when no backend exists, falling back to quit-on-close; AMBER_DISABLE_TRAY=1 force-skips it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQTVwy8RBj7spdEK3aEc3i