List-mode alt-tab oversized icons
I am running xfwm4-4.18.0 on Gentoo with the 'Cycle through windows in a list' option enabled under Window Manager Tweaks->Cycling. With the instant messaging application Discord running, alt-tabbing displays the icon with a larger resolution than any other icons.
My investigation has determined that gtk_icon_theme_load_icon
being called in getAppIcon
in src/icons.c
does not guarantee that the returned resource is of the size requested in its parameters.
I have fixed it on my end with the following patch:
diff -Naur xfwm4-4.18.0/src/icons.c xfwm4-4.18.0-fix-bigicons/src/icons.c
--- xfwm4-4.18.0/src/icons.c 2022-11-01 02:53:49.000000000 -0700
+++ xfwm4-4.18.0-fix-bigicons/src/icons.c 2024-04-04 16:54:45.986753855 -0700
@@ -558,6 +558,11 @@
0, NULL);
if (icon)
{
+ if(gdk_pixbuf_get_height (icon) > height || gdk_pixbuf_get_width (icon) > width) {
+ GdkPixbuf *resized_icon = gdk_pixbuf_scale_simple (icon, width, height, GDK_INTERP_BILINEAR);
+ g_object_unref (icon);
+ icon = resized_icon;
+ }
return icon;
}
}
But I have zero experience with GTK+ prior to this, so I can't even remotely begin to assert that it is free of issues.
Attached are images demonstrating both the issue and the results of applying the patch.