encharm / libsystemtray

Library for creating system tray icons in Plasma5, other backends are welcome as pull requests
MIT License
12 stars 4 forks source link

Fix build with GCC 11.4 and update readme #4

Closed topeterk closed 3 months ago

topeterk commented 3 months ago

Add missing includes Add missing return statement Add note about prerequisits required for building

Rush commented 3 months ago

Thank you for your contribution. I am curious - what's the use case for this library? I originally built it for the Unreal Editor but they didn't end up using it :-)

topeterk commented 3 months ago

You're welcome.

I am working on SystemTrayMenu which is an Avalonia project that has TrayIcon support. Unfortunately the Icon doesn't react on a left click on Ubuntu and I tried to find the issue. So I looked up how Avalonia is doing this stuff and I found out that is uses the Freedesktop DBus for that. But Avalonia code looked fine, so I tried to find a way to test if another implementation also do not work and that is why I found this project here. An icon seems to be created with libsystemtray but also no reaction on the left click. After little more research, using dbus-sent I could finally see that sending the event (calling Activate method) manually that my application works as intended and could confirm that its the system's, and not the application's fault. It seems that Gnome does not implement left click actions (properly?).

And because I had to make these changes to get it compiled, I thought why not sending it in :)

Rush commented 3 months ago

Ah interesting. Yes, left-mouse click was my motivation to tackle the KDE DBUS interface. The GNOME way of no left click handler is absurd. :)

Feel free to copy&paste the code from this library.

Avalonia sounds like an amazing project. Pity that it didn't exist 10 years ago. :)