diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h index 02eb95e52..b8028925e 100644 --- a/src/st/st-theme-node-private.h +++ b/src/st/st-theme-node-private.h @@ -105,7 +105,7 @@ struct _StThemeNode { int box_shadow_min_width; int box_shadow_min_height; - guint stylesheets_changed_id; + gulong stylesheets_changed_id; CoglTexture *border_slices_texture; CoglPipeline *border_slices_pipeline; diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index b471ad72b..31b27583c 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -75,6 +75,10 @@ maybe_free_properties (StThemeNode *node) cr_declaration_destroy (node->inline_properties); node->inline_properties = NULL; } + + g_clear_signal_handler (&node->stylesheets_changed_id, node->theme); + + node->properties_computed = FALSE; } static void @@ -472,6 +476,16 @@ ensure_properties (StThemeNode *node) node->n_properties = properties->len; node->properties = (CRDeclaration **)g_ptr_array_free (properties, FALSE); } + + if (!node->stylesheets_changed_id) + { + node->stylesheets_changed_id = + g_signal_connect_object (node->theme, + "custom-stylesheets-changed", + G_CALLBACK (maybe_free_properties), + G_OBJECT (node), + G_CONNECT_SWAPPED); + } } }