Commit 77bc2dc8 authored by Jonas Ådahl's avatar Jonas Ådahl

gtk/icon-theme: Handle lack of SVG loader gracefully

When loading a SVG icon from a gresource file only containing SVG icons,
but without having a SVG loader available in gdk-pixbuf, we would crash
when trying to eventually load the resource. Fix this by gracefully
handling this by simply failing to load the icon, while the first time
it happens, log a warning.

parent 01d2ef6c
......@@ -1806,6 +1806,20 @@ real_choose_icon (GtkIconTheme *icon_theme,
icon_info->filename = g_strdup (unthemed_icon->svg_filename);
else if (unthemed_icon->no_svg_filename)
icon_info->filename = g_strdup (unthemed_icon->no_svg_filename);
static gboolean warned_once = FALSE;
if (!warned_once)
g_warning ("Found an icon but could not load it. "
"Most likely gdk-pixbuf does not provide SVG support.");
warned_once = TRUE;
g_clear_object (&icon_info);
goto out;
if (unthemed_icon->is_resource)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment