clutter: Only redraw affected portions on parent widget on show/hide

If we are lucky enough and the parent actor has the CLUTTER_ACTOR_NO_LAYOUT
flag, we would skip the relayout, but still redraw the parent actor in its
entirety.

In these cases, we can at least just redraw the area affected by the actor
being shown/hidden.
This commit is contained in:
Carlos Garnacho 2018-08-10 21:33:50 +02:00 committed by Georges Basile Stavracas Neto
parent bf4ccd21c1
commit ffaec917e5

View File

@ -1793,7 +1793,7 @@ clutter_actor_show (ClutterActor *self)
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]); g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
if (priv->parent != NULL) if (priv->parent != NULL)
clutter_actor_queue_redraw (priv->parent); clutter_actor_queue_redraw (self);
g_object_thaw_notify (G_OBJECT (self)); g_object_thaw_notify (G_OBJECT (self));
} }
@ -1918,8 +1918,10 @@ clutter_actor_hide (ClutterActor *self)
g_signal_emit (self, actor_signals[HIDE], 0); g_signal_emit (self, actor_signals[HIDE], 0);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]); g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
if (priv->parent != NULL) if (priv->parent != NULL && priv->needs_allocation)
clutter_actor_queue_redraw (priv->parent); clutter_actor_queue_redraw (priv->parent);
else
clutter_actor_queue_redraw_on_parent (self);
g_object_thaw_notify (G_OBJECT (self)); g_object_thaw_notify (G_OBJECT (self));
} }