Closed guihkx closed 1 year ago
This was first noticed by @nuttyartist in https://github.com/nuttyartist/notes/pull/492#issuecomment-1439978645 while he was testing in elementaryOS 5.
Well, if system tray doesn't exist maybe we shouldn't support/show the Menu Action at all? I think that way is better.
Although as a note, the PR does work for me on Elementary OS 5 Qt5.
Well, if system tray doesn't exist maybe we shouldn't support/show the Menu Action at all? I think that way is better.
I thought the same thing, though at least on Linux the system tray can become available or disappear while the app is running. The documentation notes:
If the system tray is currently unavailable but becomes available later, QSystemTrayIcon will automatically add an entry in the system tray if it is visible.
Unfortunately there appears to be no signal provided so we could know when the system tray becomes available. I'm not sure if it would be alright to just check the availability on startup.
Oh ok, then. Let's keep it as it is.
Thanks for testing :)
Merging...
Some Linux desktop environments (e.g. GNOME) don't support system tray icons natively, so let's make sure a system tray exists before we try to hide our window, otherwise users won't be able to quit the app.