diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 1bd88bcd3..d3ca1b22d 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -2201,11 +2201,19 @@ unrealize_actor_after_children_cb (ClutterActor *self, int depth, void *user_data) { + ClutterActor *stage = _clutter_actor_get_stage_internal (self); + /* We want to unset the realized flag only _after_ * child actors are unrealized, to maintain invariants. */ CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_REALIZED); g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_REALIZED]); + + if (stage != NULL && + self->priv->parent != NULL && + self->priv->parent->flags & CLUTTER_ACTOR_NO_LAYOUT) + clutter_stage_dequeue_actor_relayout (CLUTTER_STAGE (stage), self); + return CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE; } diff --git a/clutter/clutter/clutter-stage-private.h b/clutter/clutter/clutter-stage-private.h index 7297d56a6..f2a371c5e 100644 --- a/clutter/clutter/clutter-stage-private.h +++ b/clutter/clutter/clutter-stage-private.h @@ -141,6 +141,9 @@ void clutter_stage_presented (ClutterStage *stag void clutter_stage_queue_actor_relayout (ClutterStage *stage, ClutterActor *actor); +void clutter_stage_dequeue_actor_relayout (ClutterStage *stage, + ClutterActor *actor); + GList * clutter_stage_get_views_for_rect (ClutterStage *stage, const graphene_rect_t *rect); diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index e9368fe44..51f738217 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -1202,6 +1202,28 @@ clutter_stage_queue_actor_relayout (ClutterStage *stage, g_object_ref (actor)); } +void +clutter_stage_dequeue_actor_relayout (ClutterStage *stage, + ClutterActor *actor) +{ + ClutterStagePrivate *priv = stage->priv; + GSList *l; + + for (l = priv->pending_relayouts; l; l = l->next) + { + ClutterActor *relayout_actor = l->data; + + if (relayout_actor == actor) + { + g_object_unref (relayout_actor); + priv->pending_relayouts = + g_slist_delete_link (priv->pending_relayouts, l); + + return; + } + } +} + void clutter_stage_maybe_relayout (ClutterActor *actor) { @@ -1227,10 +1249,6 @@ clutter_stage_maybe_relayout (ClutterActor *actor) if (CLUTTER_ACTOR_IN_RELAYOUT (queued_actor)) /* avoid reentrancy */ continue; - /* An actor may have been destroyed or hidden between queuing and now */ - if (clutter_actor_get_stage (queued_actor) != actor) - continue; - if (queued_actor == actor) CLUTTER_NOTE (ACTOR, " Deep relayout of stage %s", _clutter_actor_get_debug_name (queued_actor));