Handle a clone of an actor with an unmapped parent
If we are cloning an source actor with an unmapped parent, then when we temporarily map the source actor: - We need to skip the check that a mapped actor has a mapped parent. - We need to realize the actor's parents before mapping it, or we'll get an assertion failure in clutter_actor_update_map_state() because an actor with an unmapped parent is !may_be_realized. http://bugzilla.openedhand.com/show_bug.cgi?id=1633 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
d8459b0a32
commit
009eafb9ee
@ -574,19 +574,19 @@ clutter_actor_verify_map_state (ClutterActor *self)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClutterActor *parent = priv->parent_actor;
|
ClutterActor *iter = self;
|
||||||
|
|
||||||
/* check for the enable_paint_unmapped flag on any of the
|
/* check for the enable_paint_unmapped flag on the actor
|
||||||
* parents; if the flag is enabled at any point of this
|
* and parents; if the flag is enabled at any point of this
|
||||||
* branch of the scene graph then all the later checks
|
* branch of the scene graph then all the later checks
|
||||||
* become pointless
|
* become pointless
|
||||||
*/
|
*/
|
||||||
while (parent != NULL)
|
while (iter != NULL)
|
||||||
{
|
{
|
||||||
if (parent->priv->enable_paint_unmapped)
|
if (iter->priv->enable_paint_unmapped)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
parent = parent->priv->parent_actor;
|
iter = iter->priv->parent_actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CLUTTER_ACTOR_IS_VISIBLE (priv->parent_actor))
|
if (!CLUTTER_ACTOR_IS_VISIBLE (priv->parent_actor))
|
||||||
@ -8568,9 +8568,19 @@ _clutter_actor_set_enable_paint_unmapped (ClutterActor *self,
|
|||||||
priv->enable_paint_unmapped = enable;
|
priv->enable_paint_unmapped = enable;
|
||||||
|
|
||||||
if (priv->enable_paint_unmapped)
|
if (priv->enable_paint_unmapped)
|
||||||
clutter_actor_update_map_state (self, MAP_STATE_MAKE_MAPPED);
|
{
|
||||||
|
/* Make sure that the parents of the widget are realized first;
|
||||||
|
* otherwise checks in clutter_actor_update_map_state() will
|
||||||
|
* fail.
|
||||||
|
*/
|
||||||
|
clutter_actor_realize (self);
|
||||||
|
|
||||||
|
clutter_actor_update_map_state (self, MAP_STATE_MAKE_MAPPED);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
clutter_actor_update_map_state (self, MAP_STATE_MAKE_UNMAPPED);
|
{
|
||||||
|
clutter_actor_update_map_state (self, MAP_STATE_MAKE_UNMAPPED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user