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 <ebassi@linux.intel.com>
This commit is contained in:
Owen W. Taylor 2009-10-05 23:20:07 -04:00 committed by Emmanuele Bassi
parent 571df43b6d
commit c137010524

View File

@ -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);
}
}