icon-loader: fix a few more missing icons

By:
- stripping extensions from relative icon filenames (for example,
  gdmap.desktop has "Icon=gdmap_icon.png")
- using the WM_CLASS "instance" rather than "class" string, which
  is usually the same but lowercase
This commit is contained in:
John Lindgren 2024-10-04 17:31:58 -04:00 committed by Johan Malm
parent c2a3a354db
commit 977d561695
2 changed files with 35 additions and 3 deletions

View file

@ -489,9 +489,17 @@ xwayland_view_get_string_prop(struct view *view, const char *prop)
if (!strcmp(prop, "class")) {
return xwayland_surface->class;
}
/* We give 'class' for wlr_foreign_toplevel_handle_v1_set_app_id() */
/*
* Use the WM_CLASS 'instance' (1st string) for the app_id. Per
* ICCCM, this is usually "the trailing part of the name used to
* invoke the program (argv[0] stripped of any directory names)".
*
* In most cases, the 'class' (2nd string) is the same as the
* 'instance' except for being capitalized. We want lowercase
* here since we use the app_id for icon lookups.
*/
if (!strcmp(prop, "app_id")) {
return xwayland_surface->class;
return xwayland_surface->instance;
}
return "";
}