Commit 2c613166 authored by Benjamin Otte's avatar Benjamin Otte

cssnode: Catch case where a style didn't change

Catch the case where a CSS style did not change and don't emit the
style-changed signal in that case.

This saves not only the emission of the signal, but also doesn't cause
invalidation in child nodes, which would previously get a PARENT_STYLE
parent 971a2774
......@@ -950,17 +950,20 @@ gtk_css_node_set_style (GtkCssNode *cssnode,
GtkCssStyle *style)
{
GtkCssStyleChange change;
gboolean style_changed;
if (cssnode->style == style)
return FALSE;
gtk_css_style_change_init (&change, cssnode->style, style);
g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
style_changed = gtk_css_style_change_has_change (&change);
if (style_changed)
g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
gtk_css_style_change_finish (&change);
return TRUE;
return style_changed;
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment