mrclksr / DSBMC-GTK

The old GTK+/3 client for DSBMD
https://freeshell.de/~mk/projects/dsbmc.html
Other
5 stars 2 forks source link

Systray icon #2

Open Peter2121 opened 7 years ago

Peter2121 commented 7 years ago

Playing with DSBMC, I found that it supports minimizing to tray. The problem - it seems that it is realized using 'old way', so Enlightenment 21 systray module does not show DSBMC icon. Third-party apps (tint2, for example) show the icon correctly.

The reason of such problem is explained in E-devel maillist - the systray module from recent Enlightenment supports Appindicator only, not supporting Xembed:

There are currently two main ways for implementing systray in Linux, Xembed (legacy) and appindicator (fairly new).

Xembed: this is the legacy way of doing it. An application which wants to have a systray icon creates a small (22x22 px) window which gets embedded into the systray gadget. This is a window like any other, so for better or worse, everything is user controlled, including ugly inconsistent behaviour. To make things even worse, those "windows" usually don't have a transparent background, but instead use hacks to determine what solid colour background they should use, making themability, something we care about a lot in E, suck.

Appindicator: dis is a specification that start by the KDE devs a while back, and was adopted by unity/ubuntu. It's essentially a dbus api, which means the shell (enlightenment) has more control regarding look, feel and behaviour, and makes the shelf more consistent among apps.

Major issues with Xembed: Apart from the issues mentioned above, xembed is also broken because it (obviously) doesn't work under wayland, it doesn't work with higher dpi screens (remember the 22x22 restriction?), clients implement it in a hacky way, and that means servers have to adapt, making it very painful to support, and last, but not least, it's considered obsolete by many people in the Linux world, namely us.

Rest of the ecosystem: From what I understand, KDE5 will have no xembed support, Unity already doesn't support it, and I hope we and many others will follow. I don't remember the exact list, but from the kde blog (see link below) and off the top of my head, in elm we only support appindicator for systray, most Qt and GTK+ apps support it, dropbox and steam also use it, so it's really just skype that's broken, I'd complain to support and get it working. If you encounter anything else that doesn't, just open a ticket at the respective project.

http://blog.martin-graesslin.com/blog/2014/03/system-tray-in-plasma-next/

So, probably DSBMC is using Xembed, not compatible with Enlightenment, Unity and KDE5.

Is it possible to add Appindicator support to DSBMC?

mrclksr commented 7 years ago

Hi Peter,

as far as I know, Appindicator is not supported on FreeBSD yet. But you could use Stalonetray.

Best regards, Marcel

Peter2121 commented 7 years ago

There is no problem for me, I'm using tint2, it works fine (unfortunately, DSBMC is not the only tool I'm using, having problem with Enlightenment systray). I've tried pc-mounttray from PCBSD (TrueOS now) project (mount does not work correctly with it) - his tray icon is correctly shown in Enlightenment systray. This tool is created using Qt5, I suppose that it's using Appindicator or a correct fallback to be compatible with 'modern' trays.

mrclksr commented 7 years ago

Hi Peter,

I intend to switch from GTK+ to Qt, but unfortunately I'm too busy at the moment.

Best regards, Marcel

Peter2121 commented 4 years ago

Probably, with GTK3 showing the icon in new systray could be possible? I've just tested - it is not present :( BTW, the icon of dsbmixer is shown correctly...

mrclksr commented 4 years ago

I'm already working on the Qt5 version of DSBMC. I hope to push it next week.

Peter2121 commented 4 years ago

Thanks a lot! Does it mean that GTK3 version cannot show the icon in new systray at all? Or it needs more work with the GTK3 version of DSBMC?

mrclksr commented 4 years ago

Does it mean that GTK3 version cannot show the icon in new systray at all? Or it needs more work with the GTK3 version of DSBMC?

I guess there sure is a way, but I don't have the time to investigate, since I plan to completely change to Qt. DSBMC is the last one to rewrite. Have you already checked if the icon is simply missing in your current icon theme? How about other GTK3 programs with tray icons? Do they show up? Maybe try the GTK2 version of DSBMC (make GTKVER=2.0).

Peter2121 commented 4 years ago

Have you already checked if the icon is simply missing in your current icon theme?

The icon is correctly shown in tint2 (GTK2 and GTK3 versions of DSBMC)

How about other GTK3 programs with tray icons?

I've just tested Remmina - it has the same behaviour than DSBMC (icon is shown in tint2 only).

OK, I'll wait for Qt version, hope it will not be more heavy than GTK version ;) Thank you!

mrclksr commented 4 years ago

It's not complete yet, but usable:

https://github.com/mrclksr/DSBMC-Qt

Peter2121 commented 4 years ago

Thanks a lot, tested it. The icon is present in both trays, but once minimized the window does not come back. Hope, it will be fixed in the final version ;)

mrclksr commented 4 years ago

Fixed: https://github.com/mrclksr/DSBMC-Qt/commit/667799fe747b3b7612a0ec216b7c434dcc2a5705

Peter2121 commented 4 years ago

Indeed, fixed :)