mate-desktop / marco

MATE default window manager
https://mate-desktop.org
GNU General Public License v2.0
193 stars 86 forks source link

iconcache: Use GDesktopAppInfo to find correct application icons #683

Closed vkareh closed 3 years ago

vkareh commented 3 years ago

Some files do not report their application icons correctly in the window properties. This patch allows the marco UI to search for the corresponding .desktop file and render the icon in the desktop info on both the alt-tab popup and the window mini-icon.

Before: Screenshot at 2021-05-26 14-17-59

After: Screenshot at 2021-05-26 14-12-26

lukefromdc commented 3 years ago

Also note that this icon is picked separately in compiz-reloaded's gtk-window-decorator, calling code in libwnck rather than libmarco, so no effect on that.

balazs-endresz commented 1 year ago

At least libwnck does notice changes to _NET_WM_ICON. E.g. creating a new file with the following and adding the path to the Exec command in the .desktop file helps fix it for the taskbar too.

#!/bin/bash
/usr/bin/slack &
sleep 5
cp -n /usr/share/pixmaps/slack.png ~/snap/xseticon/current/slack.png  # snaps can't access the original location
wmctrl -lx | grep slack.Slack | cut -d' ' -f1 | xargs -I{} xseticon -id {} ~/snap/xseticon/current/slack.png

But I guess implementing this PR in libwnck would be even better, it looks like the code is structured somewhat similarly, see _wnck_read_icons.