st-theme-node: Recalculate properties on stylesheet changes
As theme nodes keep a cache of matched properties, we need to make
sure to update it when the list of stylesheets changes. In particular
this fixes a regression from commit dc2ec0a8f9
, which caused
extensions with stylesheets to crash the shell when re-enabled (for
instances when coming back from the lock screen).
https://bugzilla.gnome.org/show_bug.cgi?id=692994
This commit is contained in:
parent
2cf403a3e9
commit
655dce6a4b
@ -61,6 +61,14 @@ st_theme_node_class_init (StThemeNodeClass *klass)
|
|||||||
object_class->finalize = st_theme_node_finalize;
|
object_class->finalize = st_theme_node_finalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_custom_stylesheets_changed (StTheme *theme,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
StThemeNode *node = data;
|
||||||
|
node->properties_computed = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
st_theme_node_dispose (GObject *gobject)
|
st_theme_node_dispose (GObject *gobject)
|
||||||
@ -85,6 +93,10 @@ st_theme_node_dispose (GObject *gobject)
|
|||||||
node->icon_colors = NULL;
|
node->icon_colors = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node->theme)
|
||||||
|
g_signal_handlers_disconnect_by_func (node->theme,
|
||||||
|
on_custom_stylesheets_changed, node);
|
||||||
|
|
||||||
g_clear_object (&node->theme);
|
g_clear_object (&node->theme);
|
||||||
|
|
||||||
G_OBJECT_CLASS (st_theme_node_parent_class)->dispose (gobject);
|
G_OBJECT_CLASS (st_theme_node_parent_class)->dispose (gobject);
|
||||||
@ -221,10 +233,11 @@ st_theme_node_new (StThemeContext *context,
|
|||||||
theme = parent_node->theme;
|
theme = parent_node->theme;
|
||||||
|
|
||||||
if (theme != NULL)
|
if (theme != NULL)
|
||||||
node->theme = theme;
|
{
|
||||||
|
node->theme = g_object_ref (theme);
|
||||||
if (node->theme != NULL)
|
g_signal_connect (node->theme, "custom-stylesheets-changed",
|
||||||
g_object_ref (node->theme);
|
G_CALLBACK (on_custom_stylesheets_changed), node);
|
||||||
|
}
|
||||||
|
|
||||||
node->element_type = element_type;
|
node->element_type = element_type;
|
||||||
node->element_id = g_strdup (element_id);
|
node->element_id = g_strdup (element_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user