Avoid crashing when an actor not parented to a toplevel is cloned
If we can't realize the source actor for a clone, simply skip updating the map state and painting it. https://bugzilla.gnome.org/show_bug.cgi?id=745517
This commit is contained in:
parent
86a65ddffc
commit
76c8cd292e
@ -15938,6 +15938,10 @@ _clutter_actor_set_enable_paint_unmapped (ClutterActor *self,
|
||||
*/
|
||||
clutter_actor_realize (self);
|
||||
|
||||
/* If the actor isn't ultimately connected to a toplevel, it can't be
|
||||
* realized or painted.
|
||||
*/
|
||||
if (CLUTTER_ACTOR_IS_REALIZED (self))
|
||||
clutter_actor_update_map_state (self, MAP_STATE_MAKE_MAPPED);
|
||||
}
|
||||
else
|
||||
|
@ -184,9 +184,15 @@ clutter_clone_paint (ClutterActor *actor)
|
||||
was_unmapped = TRUE;
|
||||
}
|
||||
|
||||
/* If the source isn't ultimately parented to a toplevel, it can't be
|
||||
* realized or painted.
|
||||
*/
|
||||
if (clutter_actor_is_realized (priv->clone_source))
|
||||
{
|
||||
_clutter_actor_push_clone_paint ();
|
||||
clutter_actor_paint (priv->clone_source);
|
||||
_clutter_actor_pop_clone_paint ();
|
||||
}
|
||||
|
||||
if (was_unmapped)
|
||||
_clutter_actor_set_enable_paint_unmapped (priv->clone_source, FALSE);
|
||||
|
Loading…
Reference in New Issue
Block a user