user-none / KDocker

Dock most applications to the system tray
GNU General Public License v2.0
301 stars 22 forks source link

Fetch icon from _NET_WM_ICON if not in WM_CLASS #129

Closed Misko-2083 closed 1 month ago

Misko-2083 commented 2 months ago

also removed XpmCreateDataFromPixmap fixes #128

Daxx commented 2 months ago

Hi Misko,

Is this based on code from another project or have you researched it yourself?

Looks fine but I can't tell if it will work with a variety of X11 window managers.

My suggestion to try QIcon::fromTheme() might not be useful according to this StackOverflow answer and I wonder if your implementation improves on that.

Thanks, anyway. Apologies for asking questions if English is not your first language.

Misko-2083 commented 2 months ago

Should work on all, because it retrieves the icon data from X11 window hints and properties in ARGB format and converts to Qt format Qrgb. Some older applications or simpler ones may set their icon using WM hints. Many modern applications set their icons using the _NET_WM_ICON property. So trying both methods ensures we cover both cases.

Daxx commented 1 week ago

Problem seems to be with Gnome app icons on non-Gnome systems (? - Don't hold me to that)

Thunderbird toolkit is XUL, which is GTK-based (so I read) Sublime Text is also a GTK app.

If anyone want to try debugging this, here's an app to test with:

sudo apt install gnome-calculator

user-none commented 1 week ago

Problem seems to be with Gnome app icons on non-Gnome systems (? - Don't hold me to that)

Thunderbird toolkit is XUL, which is GTK-based (so I read) Sublime Text is also a GTK app.

If anyone want to try debugging this, here's an app to test with:

sudo apt install gnome-calculator

I'm not sure this is the case. I actually tested on KDE with gnome-calculator specifically. Along with a variety of Qt, GTK, and other apps. I did some testing with other DEs too but it was primarily KDE (as usual). I just tested gnome-calculator again and it's still working for me. :-/

I have an idea of maybe a fix but I won't have it ready until this evening.