-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support StatusNotifiers properly on all desktops #73
Comments
Problem with AppIndicator is that it's little limited in features - namely, it's missing 'clicked' signal, preventing me from implementing traditional "left click shows window, right click shows menu" behavior. So while I can use it as fallback on environment that doesn't support Freedesktop tray specification, I don't see reason why use reduced functionality as default. What |
By the way, MATE and XFCE doesn't support AppIndicator. AppIndicator falls back to Freedesktop specification outside of Unity. But, of course, if there is dependable way how to check that KDE5 is running, I have no problem with adding such check. |
@kozec That's not entirely true, there's indicator applets made for both MATE and Xfce; their usage is just not as needed as it could be right now. It'd also allow for possibly more creative design, status-wise. |
Sorry, I probably let most important question lost in that wall of text of mine: What XDG_CURRENT_DESKTOP value is set under KDE5? |
On KDE 5 its
This will print |
Dunno, doing that would introduce dependency on python-xlib package, so blacklisting two DE's where system tray doesn't work sounds like better solution. I don't expect (or rather I do hope :D) that no other DE plans to break system tray support in future :) |
Found something interesting: When an StatusNotifier application exposes the Now the bad news: The Would you accept a pull-request that implements the StatusNotifierItem on top of GDBus and ditches the AppIndicator library entirely? It would probably take ~2000 LOC... |
Dunno, that's about 1/4 of entire codebase for fixing something that isn't broken :D |
Yes, it's kind of broken IMHO...
Hmm... One could use the original KStatusNotifierItem API, there are no KDE 5 bindings of this yet, but the KDE 4 one's should work. Unfortunately using this API would load most of the KDE frameworks 4 libraries at startup. Some things I just found out about GtkStatusIcon in the meantime:
|
And that's what it does :) It looks and works as any other, systray specification conforming icon. It's certainly bad when some DE decides to remove support for tray icons, but it's not bug in ST-GTK. I'm all for workaround, if it's easy enough to do, but workaround sized as 1/4 of codebase is simply not maintainable. And if I understood correctly, current workaround should work in KDE5. Am I mistaken? Anyway, using |
Yes, current workaround kind-of works on KDE5, but there are several issues:
Also the idea of using GDBus from Python to do anything is completely illusionary because of this bug (yes there has been some patch for this for >3 years, but every year around fall they then decided they would like to fix it differently, another patch was proposed and they waited until fall...). Found that out the hard way :-( Not sure if I'll look at KStatusNotifierItem or PyQt5 next... |
Bear in mind that entire application uses GTK and runs around gtk_main loop. I never tried it, but it combining QT and GTK in one process can turn out problematic.
But that's not bug, that's feature. Let me quote AppIndicator project site
Support for icon theming is separate problem and can be done with Gtk.StatusIcon. I just never thought it's important enough (and probably failed to do it right in first place) |
According to the LXDE people (they migrated to Qt entirely) its not a big issue, but we'll see...
I guess I got that wrong when opening this bug: AppIndicators are NOT StatusNotifiers! AppIndicators are a LIMITED SUBSET of StatusNotifiers for the Unity desktop. StatusNotifiers allow several things that Canonical doesn't want you to do... I didn't know that back when I opened this bug, but (as is documented here) I've since done a lot of research. The title should probably be changed to something like "Support StatusNotifiers properly on all desktops".
Probably a good idea to implement that while we're at it ;-) I'm pretty confident it will solve the broken icon problem on KDE5 as well. @TiZ-EX1 By "standing out" I actually meant something like this: |
Sooo, If I understand correctly, what KDE5 actually uses is third, completely non-standard specification for tray icons? :D Is there any python binding for that? |
No, its not that bad. :-) That means:
I already have a working version of Syncthing-GTK that works well on KDE, but I haven't tested it on non-KDE (especially Unity) yet and the original |
I just hope that you do realize that this equally applies to ST-GTK supplying correct icon using system tray protocol and KDE5 ignoring it :D Anyway, I have nothing against pull request, as long as it doesn't break anything else. |
In the file
syncthing_gtk/statusicon.py
, you are checking whether you are in "THE_HELL"/Unity desktop environment to determine whethergi.repository.AppIndicator
orgtk.StatusIcon
should be used for displaying the notification area icon.Aside from the fact that the old system tray tends to produce visual glitches and is not supported on wayland anymore the general trends seems to be to drop it entirely: Unity led the way in 2010 by inventing AppIndicators and supporting them in Unity and disabling the system tray for most applications 2 years later. Since then several desktop environments have added support for appindicators (including at least KDE, MATE and XFCE) and with KDE 5, KDE has dropped support for the legacy system tray as well.
You could, of course add another check that also tries to use AppIndicators on KDE 5, but it would probably be a better idea to just always use the AppIndicator library when its available and only fall back to gtk.StatusIcon if its not (please remember that libappindicator falls back to GtkStatusIcon internally if the current desktop/GNOME does not provide support). According to that page it is also possible to use libappindicator in a way that it allows you to render your own custom system tray icon if the desktop does not support appindicators (but the code example is unfortunately gone).
Please consider making AppIndicators the default! If you really don't like the idea at all please at least consider adding KDE to list of desktop environment that are "allowed" to have appindicators...
(For now the workaround on KDE 5 is to start SyncThing-GTK like this:
env XDG_CURRENT_DESKTOP=Unity syncthing-gtk
)The text was updated successfully, but these errors were encountered: