forked from AuroraMiddleware/gtk
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
This commit is contained in:
parent
971a277419
commit
2c61316677
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user