From 0d01d958acc3606850326e0a2f8404ddcf196571 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Fri, 4 Oct 2024 14:05:31 -0400 Subject: [PATCH] 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. --- src/icon-loader.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/icon-loader.c b/src/icon-loader.c index 83d91c50..bd76042e 100644 --- a/src/icon-loader.c +++ b/src/icon-loader.c @@ -160,6 +160,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;