Fallback icons in xfce4-panel tasklist for certain applications
On wayland (labwc), certain applications (Obsidian, Anki, etc.) are having fallback icons being displayed in xfce4-panel tasklist even when the relevant icons exist in `/usr/share/pixmaps`. This is similar to https://gitlab.xfce.org/xfce/libxfce4windowing/-/work_items/46, but I can confirm that this issue occurs in the latest git build. The `obsidian.desktop` file contains ``` [Desktop Entry] Name=Obsidian Exec=/usr/bin/obsidian %U Terminal=false Type=Application Icon=obsidian StartupWMClass=obsidian Comment=Obsidian MimeType=x-scheme-handler/obsidian; Categories=Office; ``` which uses a **relative** path to the icon, which I think is why https://gitlab.xfce.org/xfce/libxfce4windowing/-/merge_requests/78 doesn't fix this. Claude Opus suggested the following patch, which is what I'm using as a fix for now: ```diff index af04e60..053e2a0 100644 --- a/libxfce4windowing/libxfce4windowing-private.c +++ b/libxfce4windowing/libxfce4windowing-private.c @@ -162,7 +162,20 @@ _xfw_gicon_load(GIcon *gicon, gint size, gint scale) { GIcon * _xfw_g_icon_new(const gchar *icon_name) { if (icon_name != NULL) { - if (gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), icon_name)) { + /* gtk_icon_theme_has_icon() only considers icons that belong to an + * actual icon theme (e.g. hicolor); it ignores the legacy unthemed + * fallback directories (/usr/share/pixmaps, ...) that are part of the + * theme's search path. gtk_icon_theme_lookup_icon() does honor them, + * and matches what _xfw_gicon_load() ultimately uses to render the + * icon, so use it to decide whether a themed icon resolves. This lets + * apps whose .desktop Icon= only resolves to a pixmap (Obsidian, Anki, + * ...) get their real icon instead of the generic fallback. */ + GtkIconInfo *icon_info = gtk_icon_theme_lookup_icon(gtk_icon_theme_get_default(), + icon_name, + 16, + 0); + if (icon_info != NULL) { + g_object_unref(icon_info); return g_themed_icon_new(icon_name); } else if (g_path_is_absolute(icon_name) && g_file_test(icon_name, G_FILE_TEST_IS_REGULAR)) ```
issue