tray-icon icon indicating copy to clipboard operation
tray-icon copied to clipboard

Tray click events on linux not firing

Open svefro opened this issue 2 years ago • 6 comments

  • LeftClick
  • RightClick
  • DoubleClick

Are not triggered on linux.

I have found out that this is due to a limit in libappindicator used on linux.

Is it possible to switch to another lib or to submit a feature request to the maintainers of libappindicator? I can not find it.

svefro avatar Dec 10 '23 09:12 svefro

The situation on Linux is in a weird state, libappindicator is deprecated and the new maintained version is libayatana-appindicator which still doesn't support the click events, there is also KDE/freedesktop StatusNotifierItem specification and there is an implementation of it here https://github.com/iovxw/ksni but I am not sure if it supports that either or if other distros other than KDE support it.

amrbashir avatar Dec 11 '23 21:12 amrbashir

It's always in a weird state on linux :p Thanks for the informative and quick reply.

I guess that getting this to work on KDE is better than no linux distros. Anyway i think the issue should remain open until it has been resolved so it is a fully featured tray icon.

Maybe this crate should switch to use https://github.com/iovxw/ksni "under the hood"? At least if running on KDE.

svefro avatar Dec 12 '23 08:12 svefro

It works well with Tauri 1.x.

vangork avatar Dec 12 '23 11:12 vangork

The menu events yes, but not clicks on the icon itself. That never worked on v1 either.

FabianLars avatar Dec 12 '23 11:12 FabianLars

Okey. BTW, since tauri 2.0.0 removed get_item() method in the app_handle.tray(), how to change the title for an existing menu item? @FabianLars

vangork avatar Dec 12 '23 12:12 vangork

Please keep this issue for discussing Linux tray click events only. If you need help with anything, reach out to us on Discord.

amrbashir avatar Dec 12 '23 21:12 amrbashir