After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792738 - GtkIconTheme ignores exact size match for builtin icons
GtkIconTheme ignores exact size match for builtin icons
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.24.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2018-01-20 20:15 UTC by John Lindgren
Modified: 2018-02-18 03:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix incorrect optimization in find_builtin_icon() (1.16 KB, patch)
2018-01-20 20:15 UTC, John Lindgren
none Details | Review
Fix incorrect optimization in find_builtin_icon() (867 bytes, patch)
2018-01-21 07:15 UTC, John Lindgren
accepted-commit_now Details | Review

Description John Lindgren 2018-01-20 20:15:21 UTC
Created attachment 367157 [details] [review]
Fix incorrect optimization in find_builtin_icon()

I am attaching a patch to fix an incorrect optimization in find_builtin_icon().

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.

This would only affect applications using gtk_icon_theme_add_builtin_icon(), which is probably why it hasn't been noticed before.
Comment 1 John Lindgren 2018-01-21 07:15:29 UTC
Created attachment 367164 [details] [review]
Fix incorrect optimization in find_builtin_icon()

Earlier patch wasn't quite correct, still returned the wrong min_difference if there was an exact match but also a larger size of the icon.
Comment 2 Matthias Clasen 2018-01-22 21:12:41 UTC
Review of attachment 367164 [details] [review]:

seems right