mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
actor: Add internal child flag
ClutterActor checks, when destroying and reparenting, if the parent actor implements the Container interface, and automatically calls the remove() method to perform a clean removal. Actors implementing Container, though, might have internal children; that is, children that are not added through the Container API. It is already possible to iterate through them using the Container API to avoid breaking invariants - but calling clutter_actor_destroy() on these children (even from the Container implementation, and thus outside of Clutter's control) will either lead to leaks or to segmentation faults. Clutter needs a way to distinguish a clutter_actor_set_parent() done on an internal child from one done on a "public" child; for this reason, a push/pop pair of functions should be available to Actor implementations to mark the section where they wish to add internal children: ➔ clutter_actor_push_internal (); ... clutter_actor_set_parent (child1, parent); clutter_actor_set_parent (child2, parent); ... ➔ clutter_actor_pop_internal (); The set_parent() call will automatically set the newly added INTERNAL_CHILD private flag on each child, and both clutter_actor_destroy() and clutter_actor_unparent() will check for the flag before deciding whether to call the Container's remove method.
This commit is contained in:
@ -352,6 +352,8 @@ clutter_actor_lower
|
||||
clutter_actor_raise_top
|
||||
clutter_actor_lower_bottom
|
||||
clutter_actor_get_stage
|
||||
clutter_actor_push_internal
|
||||
clutter_actor_pop_internal
|
||||
|
||||
<SUBSECTION>
|
||||
clutter_actor_set_depth
|
||||
|
Reference in New Issue
Block a user