From 3f8076a085e579cda3a1b20372f3fa03d64cbe2d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 24 Jun 2024 07:39:36 -0400 Subject: [PATCH] texture: Fix an oversight construct-only properties also get set at construct time, so we need to handle NULL here, until all our texture construction methods pass a color state. --- gdk/gdktexture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c index 99647bcff8..0024e5bfee 100644 --- a/gdk/gdktexture.c +++ b/gdk/gdktexture.c @@ -287,7 +287,10 @@ gdk_texture_set_property (GObject *gobject, case PROP_COLOR_STATE: if (self->color_state) gdk_color_state_unref (self->color_state); - self->color_state = gdk_color_state_ref (g_value_get_boxed (value)); + if (g_value_get_boxed (value)) + self->color_state = gdk_color_state_ref (g_value_get_boxed (value)); + else + self->color_state = GDK_COLOR_STATE_SRGB; break; default: