]> git.mdlowis.com Git - proto/labwc.git/commitdiff
icon-loader: also match desktop entries StartupWMClass
authorJohn Lindgren <john@jlindgren.net>
Fri, 4 Oct 2024 18:05:31 +0000 (14:05 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 4 Oct 2024 21:25:37 +0000 (22:25 +0100)
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

index 20cc9b6232d07719e2df14af8cc07ffe2eb40f61..a9444fe482636bd87ade1e6b90b2fc0a8f90efc9 100644 (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;