window: Handle broken icon themes more gracefully

We assert that the icons used as default window icons are loaded correctly,
but currently this can fail simply because of an incomplete icon theme. After
all, "image-missing" was only added to the icon-naming spec in 2005 🙄

Handle this case more gracefully by falling back to a completely
transparent "icon".

https://bugzilla.gnome.org/show_bug.cgi?id=720583
https://gitlab.gnome.org/GNOME/mutter/merge_requests/462
This commit is contained in:
Florian Müllner 2019-02-27 22:11:46 +01:00
parent 16a2eab290
commit 9622733140

View File

@ -5357,7 +5357,11 @@ load_default_window_icon (int size)
icon_name = "image-missing";
pixbuf = gtk_icon_theme_load_icon (theme, icon_name, size, 0, NULL);
if (pixbuf != NULL)
return gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, NULL);
return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, size, size);
}
static cairo_surface_t *