Fix incorrect optimization in find_builtin_icon().
authorJohn Lindgren <john@jlindgren.net>
Sun, 18 Feb 2018 03:03:27 +0000 (22:03 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 18 Feb 2018 03:03:27 +0000 (22:03 -0500)
When we found an icon with exactly the requested size, we'd stop
searching immediately (good), but we'd neglect to set the returned
min_difference to 0 (bad).  This caused theme_lookup_icon() to
prefer other, potentially much worse, matches over the exact one.

gtk/gtkicontheme.c

index 3225567fb95d87828ec1b0536103de2b15ab0467..a90264d876483b8cd4b8dfb67dd25f0a42e6394d 100644 (file)
@@ -5399,6 +5399,7 @@ find_builtin_icon (const gchar *icon_name,
       
       if (difference == 0)
         {
+          min_difference = 0;
           min_icon = default_icon;
           break;
         }