icon-loader: also match desktop entries StartupWMClass

GIMP for example sets its WM_CLASS to "gimp-2.10", which does not match
the "gimp.desktop" filename, but matches the StartupWMClass key listed
in it.

Thanks to @vyivel for the suggestion.
This commit is contained in:
John Lindgren 2024-10-04 14:05:31 -04:00 committed by Johan Malm
parent eb8db30a86
commit b4bc6ffceb

View file

@ -182,6 +182,13 @@ get_db_entry_by_id_fuzzy(struct sfdo_desktop_db *db, const char *app_id)
if (!strcasecmp(app_id, desktop_id_base)) {
return entry;
}
/* Try desktop entry's StartupWMClass also */
const char *wm_class =
sfdo_desktop_entry_get_startup_wm_class(entry, NULL);
if (wm_class && !strcasecmp(app_id, wm_class)) {
return entry;
}
}
return NULL;