diff -Naur xfwm4-4.13.2/src/display.c xfwm4-4.13.2.slack-icon-bux-fixed/src/display.c --- xfwm4-4.13.2/src/display.c 2019-05-15 15:35:15.000000000 -0400 +++ xfwm4-4.13.2.slack-icon-bux-fixed/src/display.c 2019-05-30 16:58:24.654061503 -0400 @@ -160,6 +160,7 @@ "_NET_WM_WINDOW_TYPE_UTILITY", "_NET_WM_WINDOW_TYPE_NOTIFICATION", "_NET_WORKAREA", + "WM_CLASS", "MANAGER", "PIXMAP", "SM_CLIENT_ID", diff -Naur xfwm4-4.13.2/src/display.h xfwm4-4.13.2.slack-icon-bux-fixed/src/display.h --- xfwm4-4.13.2/src/display.h 2019-05-12 12:45:20.000000000 -0400 +++ xfwm4-4.13.2.slack-icon-bux-fixed/src/display.h 2019-05-30 16:52:52.369257999 -0400 @@ -252,6 +252,7 @@ NET_WM_WINDOW_TYPE_UTILITY, NET_WM_WINDOW_TYPE_NOTIFICATION, NET_WORKAREA, + WM_CLASS, MANAGER, PIXMAP, SM_CLIENT_ID, diff -Naur xfwm4-4.13.2/src/hints.c xfwm4-4.13.2.slack-icon-bux-fixed/src/hints.c --- xfwm4-4.13.2/src/hints.c 2019-05-15 16:44:58.000000000 -0400 +++ xfwm4-4.13.2.slack-icon-bux-fixed/src/hints.c 2019-05-30 18:25:31.705949898 -0400 @@ -456,6 +456,7 @@ atoms[i++] = display_info->atoms[NET_WM_WINDOW_TYPE_TOOLBAR]; atoms[i++] = display_info->atoms[NET_WM_WINDOW_TYPE_UTILITY]; atoms[i++] = display_info->atoms[NET_WORKAREA]; + atoms[i++] = display_info->atoms[WM_CLASS]; /* GTK specific hints */ atoms[i++] = display_info->atoms[GTK_FRAME_EXTENTS]; atoms[i++] = display_info->atoms[GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED]; @@ -852,6 +853,23 @@ } gboolean +getWindowClass (DisplayInfo *display_info, Window w, gchar **name, gchar **class) +{ + XClassHint hint; + int status; + status = XGetClassHint (display_info->dpy, w, &hint); + if (status != 0) { + *class = g_strdup (hint.res_class); + *name = g_strdup (hint.res_name); + // Now free the x11 resource + XFree (hint.res_class); + XFree (hint.res_name); + return TRUE; + } + return FALSE; +} + +gboolean getUTF8StringList (DisplayInfo *display_info, Window w, int atom_id, gchar ***str_p, guint *n_items) { char *xstr, *ptr; diff -Naur xfwm4-4.13.2/src/hints.h xfwm4-4.13.2.slack-icon-bux-fixed/src/hints.h --- xfwm4-4.13.2/src/hints.h 2019-05-12 12:45:20.000000000 -0400 +++ xfwm4-4.13.2.slack-icon-bux-fixed/src/hints.h 2019-05-30 17:33:28.019601707 -0400 @@ -298,4 +298,6 @@ char **); #endif +gboolean getWindowClass (DisplayInfo *, Window, gchar **, gchar **); + #endif /* INC_HINTS_H */ diff -Naur xfwm4-4.13.2/src/icons.c xfwm4-4.13.2.slack-icon-bux-fixed/src/icons.c --- xfwm4-4.13.2/src/icons.c 2019-05-12 12:45:20.000000000 -0400 +++ xfwm4-4.13.2.slack-icon-bux-fixed/src/icons.c 2019-05-30 18:44:15.217305112 -0400 @@ -535,7 +535,22 @@ return icon; } } - + else + { + gchar *name; + gchar *class; + if (getWindowClass (screen_info->display_info, window, &name, &class)) + { + GtkIconTheme *theme = gtk_icon_theme_get_default (); + GdkPixbuf *icon = gtk_icon_theme_load_icon (theme, name, width, 0, NULL); + g_free (name); + g_free (class); + if (icon) + { + return icon; + } + } + } return default_icon_at_size (screen_info->gscr, width, height); }