From c13701052497b4cdb009f95ad8ccce9f4a7d825e Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 5 Oct 2009 23:20:07 -0400 Subject: [PATCH] Force a relayout when showing an actor When an actor is hidden, the parent actor is not required to size request or allocate it. (ClutterGroup does, but, for example, NbtkBoxLayout doesn't.) This means that the needs_width_request/needs_height_request/needs_allocate can be stale when we go to show it again - they are set for the actor but not the parent. Explicitly setting them to FALSE avoids clutter_actor_relayout() improperly short-circuiting. http://bugzilla.openedhand.com/show_bug.cgi?id=1831 Signed-off-by: Emmanuele Bassi --- clutter/clutter-actor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 6d75c3c5e..6035ecb7e 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -961,6 +961,8 @@ clutter_actor_real_show (ClutterActor *self) { if (!CLUTTER_ACTOR_IS_VISIBLE (self)) { + ClutterActorPrivate *priv = self->priv; + CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_VISIBLE); /* we notify on the "visible" flag in the clutter_actor_show() * wrapper so the entire show signal emission completes first @@ -968,6 +970,13 @@ clutter_actor_real_show (ClutterActor *self) */ clutter_actor_update_map_state (self, MAP_STATE_CHECK); + /* While an actor is hidden the parent may not have allocated/requested + * so we need to start from scratch and avoid the short-circuiting + * in clutter_actor_queue_relayout(). + */ + priv->needs_width_request = FALSE; + priv->needs_height_request = FALSE; + priv->needs_allocation = FALSE; clutter_actor_queue_relayout (self); } }