From 6bc7f4c723de90c41afa622dc3451ad7697786e0 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Thu, 5 Feb 2009 11:04:34 +0000 Subject: [PATCH] [actor] Force a relayout on set_parent() The current code that handles the invariant that the new parent of an actor needing a layout should also be queued for relayout is hitting the short-circuiting we do in the queue_relayout() method. In order to fix this we can forcibly set the actor to need a width/height request and an allocation; then we queue a relayout on the parent. Signed-off-by: Emmanuele Bassi --- clutter/clutter-actor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 75e927ff8..631a87c71 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -6098,7 +6098,15 @@ clutter_actor_set_parent (ClutterActor *self, priv->needs_height_request || priv->needs_allocation) { - clutter_actor_queue_relayout (self); + /* we work around the short-circuiting we do + * in clutter_actor_queue_relayout() since we + * want to force a relayout + */ + priv->needs_width_request = TRUE; + priv->needs_height_request = TRUE; + priv->needs_allocation = TRUE; + + clutter_actor_queue_relayout (priv->parent_actor); } }