Blame SOURCES/0001-gtk-icon-theme-Handle-lack-of-SVG-loader-gracefully.patch

c758dd
From e08c019f6c01a797c3eef59d900fbe09fac9ddaf Mon Sep 17 00:00:00 2001
c758dd
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
c758dd
Date: Wed, 7 Aug 2019 19:17:44 +0200
c758dd
Subject: [PATCH] gtk/icon-theme: Handle lack of SVG loader gracefully
c758dd
c758dd
When loading a SVG icon from a gresource file only containing SVG icons,
c758dd
but without having a SVG loader available in gdk-pixbuf, we would crash
c758dd
when trying to eventually load the resource. Fix this by gracefully
c758dd
handling this by simply failing to load the icon, while the first time
c758dd
it happens, log a warning.
c758dd
c758dd
https://gitlab.gnome.org/GNOME/gtk/issues/2084
c758dd
---
c758dd
 gtk/gtkicontheme.c | 13 +++++++++++++
c758dd
 1 file changed, 13 insertions(+)
c758dd
c758dd
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
c758dd
index 65c64b38e3..e5323defe8 100644
c758dd
--- a/gtk/gtkicontheme.c
c758dd
+++ b/gtk/gtkicontheme.c
c758dd
@@ -1806,6 +1806,19 @@ real_choose_icon (GtkIconTheme       *icon_theme,
c758dd
         icon_info->filename = g_strdup (unthemed_icon->svg_filename);
c758dd
       else if (unthemed_icon->no_svg_filename)
c758dd
         icon_info->filename = g_strdup (unthemed_icon->no_svg_filename);
c758dd
+      else
c758dd
+        {
c758dd
+          static gboolean warned_once = FALSE;
c758dd
+
c758dd
+          if (!warned_once)
c758dd
+            {
c758dd
+              g_warning ("Tried to load SVG only icon without SVG support");
c758dd
+              warned_once = TRUE;
c758dd
+            }
c758dd
+
c758dd
+          g_clear_object (&icon_info);
c758dd
+          goto out;
c758dd
+        }
c758dd
 
c758dd
       if (unthemed_icon->is_resource)
c758dd
         {
c758dd
-- 
c758dd
2.21.0
c758dd