mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 16:40:41 -05:00
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:
parent
16a2eab290
commit
9622733140
@ -5357,7 +5357,11 @@ load_default_window_icon (int size)
|
|||||||
icon_name = "image-missing";
|
icon_name = "image-missing";
|
||||||
|
|
||||||
pixbuf = gtk_icon_theme_load_icon (theme, icon_name, size, 0, NULL);
|
pixbuf = gtk_icon_theme_load_icon (theme, icon_name, size, 0, NULL);
|
||||||
return gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, 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 *
|
static cairo_surface_t *
|
||||||
|
Loading…
Reference in New Issue
Block a user