commit d04ae5a7c24fdc78a7f86cde60b732f518f20a23 Author: Robert Ancell Date: Thu Nov 3 14:51:43 2022 +0100 WIP diff --git a/gtk/gtkcssiconthemevalue.c b/gtk/gtkcssiconthemevalue.c index e6633c589a..fbbcb34d5e 100644 --- a/gtk/gtkcssiconthemevalue.c +++ b/gtk/gtkcssiconthemevalue.c @@ -76,12 +76,16 @@ gtk_css_value_icon_theme_compute (GtkCssValue *icon_theme, GtkCssStyle *style, GtkCssStyle *parent_style) { - GtkIconTheme *icontheme; + GtkIconTheme *icontheme = NULL; if (icon_theme->icontheme) icontheme = icon_theme->icontheme; else - icontheme = gtk_icon_theme_get_for_screen (_gtk_settings_get_screen (_gtk_style_provider_private_get_settings (provider))); + { + GtkSettings *settings = _gtk_style_provider_private_get_settings (provider); + if (settings != NULL) + icontheme = gtk_icon_theme_get_for_screen (_gtk_settings_get_screen (settings)); + } return gtk_css_icon_theme_value_new (icontheme); } diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index f6e3e2956a..461398647e 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -489,10 +489,8 @@ ensure_surface_for_gicon (GtkIconHelper *self, width, flags | GTK_ICON_LOOKUP_USE_BUILTIN | GTK_ICON_LOOKUP_GENERIC_FALLBACK, &error); - /* We include this image as resource, so we always have it available or - * the icontheme code is broken */ - g_assert_no_error (error); - g_assert (destination); + if (destination == NULL) + destination = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); symbolic = FALSE; } diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 8df1c8e861..201e447d2d 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4475,6 +4475,8 @@ icon_list_from_theme (GtkWindow *window, icon_theme = gtk_css_icon_theme_value_get_icon_theme (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET (window)), GTK_CSS_PROPERTY_ICON_THEME)); + if (icon_theme == NULL) + return NULL; sizes = gtk_icon_theme_get_icon_sizes (icon_theme, name);