Commit f74c07b9 authored by Carlos Garnacho's avatar Carlos Garnacho

st: Only emit ::style-changed on actual changes

Compare painting/geometry of old and new paint nodes, so it's ensured to
be only emitted on actual style changes. Emission still must be propagated
through to children, though.

Closes: #1153
parent 59edea4b
Pipeline #76974 passed with stages
in 3 minutes and 44 seconds
......@@ -1718,7 +1718,7 @@ st_widget_recompute_style (StWidget *widget,
StThemeNode *new_theme_node = st_widget_get_theme_node (widget);
int transition_duration;
StSettings *settings;
gboolean paint_equal;
gboolean paint_equal, geometry_equal = FALSE;
gboolean animations_enabled;
if (new_theme_node == old_theme_node)
......@@ -1729,8 +1729,9 @@ st_widget_recompute_style (StWidget *widget,
_st_theme_node_apply_margins (new_theme_node, CLUTTER_ACTOR (widget));
if (!old_theme_node ||
!st_theme_node_geometry_equal (old_theme_node, new_theme_node))
if (old_theme_node)
geometry_equal = st_theme_node_geometry_equal (old_theme_node, new_theme_node);
if (!geometry_equal)
clutter_actor_queue_relayout ((ClutterActor *) widget);
transition_duration = st_theme_node_get_transition_duration (new_theme_node);
......@@ -1782,7 +1783,11 @@ st_widget_recompute_style (StWidget *widget,
st_theme_node_paint_state_invalidate (current_paint_state (widget));
g_signal_emit (widget, signals[STYLE_CHANGED], 0);
if (!paint_equal || !geometry_equal)
g_signal_emit (widget, signals[STYLE_CHANGED], 0);
notify_children_of_style_change ((ClutterActor *) widget);
priv->is_style_dirty = FALSE;
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