summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2019-02-27 22:11:46 +0100
committerFlorian Müllner <fmuellner@gnome.org>2019-02-27 22:46:19 +0100
commit9622733140c90a472f06362fbbc970513c508735 (patch)
treebcf345c8b92fe85b76c2dc6afd21ba7f4aeeddff
parent16a2eab2907264c5fd469728a3d342f9f2bfb69c (diff)
downloadmutter-wip/fmuellner/missing-image-missing.tar.gz
window: Handle broken icon themes more gracefullywip/fmuellner/missing-image-missing
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
-rw-r--r--src/core/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/window.c b/src/core/window.c
index c112c7d59..9712e6d87 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -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);
- 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 *