mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
2008-06-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: (clutter_actor_set_parent): Do not emit ::parent-set when reparenting. (clutter_actor_unparent): Ditto, as above. (clutter_actor_reparent): Emit ::parent-set with the old parent and set the IN_REPARENT flag unconditionally.
This commit is contained in:
parent
431564dfbe
commit
988cac1dfb
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
||||
2008-06-17 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-actor.c:
|
||||
(clutter_actor_set_parent): Do not emit ::parent-set when
|
||||
reparenting.
|
||||
|
||||
(clutter_actor_unparent): Ditto, as above.
|
||||
|
||||
(clutter_actor_reparent): Emit ::parent-set with the old
|
||||
parent and set the IN_REPARENT flag unconditionally.
|
||||
|
||||
2008-06-17 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* doc/clutter-actor-invariants.txt: Document the flags, the
|
||||
|
@ -5580,6 +5580,9 @@ clutter_actor_set_parent (ClutterActor *self,
|
||||
|
||||
g_object_ref_sink (self);
|
||||
priv->parent_actor = parent;
|
||||
|
||||
/* clutter_actor_reparent() will emit ::parent-set for us */
|
||||
if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
|
||||
g_signal_emit (self, actor_signals[PARENT_SET], 0, NULL);
|
||||
|
||||
/* the invariant is: if the parent is realized, the we must be
|
||||
@ -5677,6 +5680,8 @@ clutter_actor_unparent (ClutterActor *self)
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (self))
|
||||
clutter_actor_queue_redraw (self);
|
||||
|
||||
/* clutter_actor_reparent() will emit ::parent-set for us */
|
||||
if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
|
||||
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
|
||||
|
||||
/* remove the reference we acquired in clutter_actor_set_parent() */
|
||||
@ -5716,44 +5721,36 @@ clutter_actor_reparent (ClutterActor *self,
|
||||
{
|
||||
ClutterActor *old_parent;
|
||||
|
||||
/* if the actor and the parent have already been realized,
|
||||
* mark the actor as reparenting, so that clutter_actor_unparent()
|
||||
* just hides the actor instead of unrealize it.
|
||||
*/
|
||||
if (CLUTTER_ACTOR_IS_REALIZED (self) &&
|
||||
CLUTTER_ACTOR_IS_REALIZED (new_parent))
|
||||
{
|
||||
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_REPARENT);
|
||||
}
|
||||
|
||||
old_parent = priv->parent_actor;
|
||||
|
||||
g_object_ref (self);
|
||||
|
||||
/* XXX: below assumes only containers can reparent, which is
|
||||
* a fair assumption given that composited actors will not call
|
||||
* or need clutter_actor_reparent() for internal children.
|
||||
*/
|
||||
if (CLUTTER_IS_CONTAINER (priv->parent_actor))
|
||||
clutter_container_remove_actor (CLUTTER_CONTAINER (priv->parent_actor),
|
||||
self);
|
||||
{
|
||||
ClutterContainer *parent = CLUTTER_CONTAINER (priv->parent_actor);
|
||||
|
||||
clutter_container_remove_actor (parent, self);
|
||||
}
|
||||
else
|
||||
priv->parent_actor = NULL;
|
||||
clutter_actor_unparent (self);
|
||||
|
||||
if (CLUTTER_IS_CONTAINER (new_parent))
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (new_parent), self);
|
||||
else
|
||||
priv->parent_actor = new_parent;
|
||||
clutter_actor_set_parent (self, new_parent);
|
||||
|
||||
/* we emit the ::parent-set signal once */
|
||||
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
|
||||
|
||||
g_object_unref (self);
|
||||
|
||||
if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT)
|
||||
{
|
||||
CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_REPARENT);
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (self))
|
||||
clutter_actor_queue_redraw (self);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* clutter_actor_raise:
|
||||
|
Loading…
Reference in New Issue
Block a user