summaryrefslogtreecommitdiff
path: root/win32/patches/gtkicontheme.c.diff
blob: d23a44cd4ad26f70d95176573dfab0373b5836b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From bac94a7aaf2409d673c971e0733f292e74a6cec7 Mon Sep 17 00:00:00 2001
From: John Lindgren <john@jlindgren.net>
Date: Sun, 21 Jan 2018 02:09:14 -0500
Subject: [PATCH] Fix 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.
---
 gtk/gtkicontheme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 532d94bee5..470158ceea 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3396,6 +3396,7 @@ find_builtin_icon (const gchar *icon_name,
       
       if (difference == 0)
 	{
+	  min_difference = 0;
 	  min_icon = default_icon;
 	  break;
 	}
-- 
2.16.0