mutter/clutter
Emmanuele Bassi 80626e7584 actor: Do not check for child destruction in add_child_internal()
We currently check for the IN_DESTRUCTION flag inside the
add_child_internal() function.

This check disallows calling methods that change the stacking order
within the destruction sequence, by triggering a critical warning first,
and leaving the actor in an undefined state, which then ends up being
caught by an assertion.

The reproducible sequence is:

  - actor gets destroyed;
  - another actor, linked to the first, will try to change the
    stacking order of the first actor;
  - changing the stacking order is a composite operation composed
    by the following steps:
    1. ref() the child;
    2. remove_child_internal(), which removes the reference;
    3. add_child_internal(), which adds a reference;
  - the state of the actor is not changed between (2) and (3), as
    it could be an expensive recomputation;
  - if (3) bails out, then the actor is in an undefined state, but
    still alive;
  - the destruction sequence terminates, but the actor is unparented
    while its state indicates being parented instead.
  - assertion failure.

The obvious fix would be to decompose each set_child_*_sibling() method
into proper remove_child()/add_child(), with state validation; this may
cause excessive work, though, and trigger a cascade of other bugs in
code that assumes that a change in the stacking order is an atomic
operation.

Another potential fix is to just remove this check here, and let code
doing stacking order changes inside the destruction sequence of an actor
continue doing the work.

The third fix is to silently bail out early from every
set_child_*_sibling() and set_child_at_index() method, and avoid doing
work.

I have a preference for the second solution, since it involves the least
amount of work, and the least amount of code duplication.

See bug: https://bugzilla.gnome.org/show_bug.cgi?id=670647
2012-02-29 15:20:57 +00:00
..
cally a11y: Not compute extents for actors without an stage 2012-02-29 15:52:49 +01:00
cex100 docs: fix some headers paths 2011-11-10 19:05:39 +01:00
cogl Rename cogl_framebuffer_swap_* apis to cogl_onscreen_swap_* 2012-02-21 17:46:11 +00:00
deprecated Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00
egl eglnative: fix building eglnative BE with evdev support 2011-12-08 16:13:37 +00:00
evdev build: make internal option_xkb_* symbols static 2011-12-08 16:13:38 +00:00
gdk docs: Documentation fixes 2012-02-23 12:01:11 +00:00
osx osx: Use the Stage state tracking 2012-01-26 08:30:58 +00:00
tslib egl: First attempt at cleaning up the EGL native backend 2011-11-03 13:45:20 +00:00
wayland Pass a CoglContext when calling cogl_pipeline_new 2012-02-21 17:46:11 +00:00
win32 Rename cogl_framebuffer_swap_* apis to cogl_onscreen_swap_* 2012-02-21 17:46:11 +00:00
x11 Reduce our internal dependence on the Cogl 1.x api 2012-02-21 17:46:11 +00:00
abicheck.sh build: Make abicheck.sh backend-aware 2012-02-23 17:32:32 +00:00
clutter-action.c
clutter-action.h ClutterActor: Add clutter_actor_has_actions 2011-09-29 19:34:32 +02:00
clutter-actor-box.c
clutter-actor-meta-private.h ClutterActor: Add clutter_actor_has_effects 2011-09-29 19:34:24 +02:00
clutter-actor-meta.c clutter-actor-meta: Fix _clutter_meta_group_has_metas_no_internal 2011-10-01 12:40:11 +02:00
clutter-actor-meta.h docs: Documentation fixes 2012-02-23 12:01:11 +00:00
clutter-actor-private.h actor: Move ClutterShader-related code out of clutter-actor.c 2012-01-31 11:56:59 +00:00
clutter-actor.c actor: Do not check for child destruction in add_child_internal() 2012-02-29 15:20:57 +00:00
clutter-actor.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-align-constraint.c align-constraint: Add CLUTTER_ALIGN_BOTH 2011-10-15 18:36:27 +01:00
clutter-align-constraint.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-alpha.c docs: "Soft" deprecation of ClutterAlpha 2012-02-23 11:23:15 +00:00
clutter-alpha.h Fix duplicate typedef of ClutterAlpha 2011-10-11 23:02:17 +01:00
clutter-animatable.c Add deprecated header for ClutterAnimation 2012-02-27 15:38:11 +00:00
clutter-animatable.h Add a deprecated header for ClutterAnimatable 2012-02-27 15:21:32 +00:00
clutter-animation.c animation: Deprecate Alpha usage 2012-02-23 11:23:15 +00:00
clutter-animation.h Add deprecated header for ClutterAnimation 2012-02-27 15:38:11 +00:00
clutter-animator.c script: Hide private symbols 2011-09-07 16:14:10 +01:00
clutter-animator.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-backend-private.h clutter-backend: Use the Cogl main loop mechanism 2012-02-09 16:34:25 +00:00
clutter-backend.c Update the deprecation macros 2012-02-27 15:21:31 +00:00
clutter-backend.h Loosen the guard around clutter_backend_get_cogl_context 2012-02-21 17:46:11 +00:00
clutter-bezier.c debug: Clean up debugging notes 2011-10-17 10:24:25 +01:00
clutter-bezier.h
clutter-bin-layout.c Use ClutterActorIter inside layout managers 2012-01-30 11:09:59 +00:00
clutter-bin-layout.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-bind-constraint.c ClutterBindConstraint: Add CLUTTER_BIND_ALL coordinate 2012-02-15 17:57:18 +01:00
clutter-bind-constraint.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-binding-pool.c Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-binding-pool.h Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-blur-effect.c Pass a CoglContext when calling cogl_pipeline_new 2012-02-21 17:46:11 +00:00
clutter-blur-effect.h
clutter-box-layout.c box-layout: Fix allocation brain farts 2012-02-14 16:01:21 +00:00
clutter-box-layout.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-cairo-texture.c Clean up the included headers 2012-02-23 17:21:57 +00:00
clutter-cairo-texture.h Add a deprecated header for ClutterCairoTexture 2012-02-27 15:49:58 +00:00
clutter-child-meta.c
clutter-child-meta.h docs: Fixes for cross-references 2011-09-12 13:12:14 +01:00
clutter-click-action.c click-action: Use the new symbolic event propagation macros 2012-01-12 10:27:17 +00:00
clutter-click-action.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-clone.c Avoid the shadowing of 'clone' 2011-10-19 15:23:55 +01:00
clutter-clone.h Avoid the shadowing of 'clone' 2011-10-19 15:23:55 +01:00
clutter-cogl-compat.h Reduce our internal dependence on the Cogl 1.x api 2012-02-21 17:46:11 +00:00
clutter-color-static.h static-colors: Simplify the defines 2011-09-05 17:22:14 +01:00
clutter-color.c color: Validate hex formats 2011-11-10 14:13:45 +00:00
clutter-color.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-colorize-effect.c Pass a CoglContext when calling cogl_pipeline_new 2012-02-21 17:46:11 +00:00
clutter-colorize-effect.h
clutter-config.h.in
clutter-config.h.win32 clutter-config.h.win32: Add CLUTTER_INPUT_NULL 2011-11-14 13:33:04 +08:00
clutter-constraint.c
clutter-constraint.h ClutterActor: Add clutter_actor_has_contraints 2011-09-29 19:34:31 +02:00
clutter-container.c docs: Update the Container interface documentation 2012-02-09 15:38:11 +00:00
clutter-container.h Deprecate the old raise/lower API 2012-01-16 23:37:13 +00:00
clutter-debug.h debug: Simple whitespace cleanups 2011-11-18 17:54:19 +00:00
clutter-deform-effect.c Pass a CoglContext when calling cogl_pipeline_new 2012-02-21 17:46:11 +00:00
clutter-deform-effect.h
clutter-deprecated.h Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00
clutter-desaturate-effect.c Pass a CoglContext when calling cogl_pipeline_new 2012-02-21 17:46:11 +00:00
clutter-desaturate-effect.h
clutter-device-manager-private.h input: adds internal _clutter_input_device_get_stage api 2011-12-08 16:13:37 +00:00
clutter-device-manager.c backend: Clean up the device manager creation 2011-11-10 14:55:03 +00:00
clutter-device-manager.h
clutter-drag-action.c drag-action: Use the motion event when passing the drag threshold 2012-02-23 10:51:08 +00:00
clutter-drag-action.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-drop-action.c clutter-drop-action: annotation fixes for some signals 2012-02-20 13:26:15 +01:00
clutter-drop-action.h docs: Document ClutterDropAction 2011-06-20 15:25:54 +01:00
clutter-easing.c Move the easing functions to their own file 2012-02-23 11:23:15 +00:00
clutter-easing.h Move the easing functions to their own file 2012-02-23 11:23:15 +00:00
clutter-effect-private.h effect: Rename RunFlags to PaintFlags 2011-06-13 16:00:45 +01:00
clutter-effect.c docs: Fixes for cross-references 2011-09-12 13:12:14 +01:00
clutter-effect.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-enum-types.c.in
clutter-enum-types.h.in
clutter-enums.h docs: Note when new ClutterBindCoordinate values were added 2012-02-15 17:43:31 +00:00
clutter-event-private.h
clutter-event-translator.c
clutter-event-translator.h
clutter-event.c Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-event.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-feature.c
clutter-feature.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-fixed-layout.c fixed-layout: Remove the NO_LAYOUT flag set 2012-01-27 15:45:11 +00:00
clutter-fixed-layout.h
clutter-flatten-effect.c clutter-actor: Add a 'has_overlaps' virtual 2011-05-13 01:46:32 +01:00
clutter-flatten-effect.h clutter-actor: Add a 'has_overlaps' virtual 2011-05-13 01:46:32 +01:00
clutter-flow-layout.c Use ClutterActorIter inside layout managers 2012-01-30 11:09:59 +00:00
clutter-flow-layout.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-gesture-action.c gesture-action: Protect against NULL pointers 2012-01-12 10:49:16 +00:00
clutter-gesture-action.h docs: Fix Clutter API reference 2011-06-13 15:36:07 +01:00
clutter-group.h Deprecate ClutterGroup 2012-01-16 23:35:16 +00:00
clutter-id-pool.c clutter-id-pool: fix warning on bad pick 2011-05-26 08:48:13 -04:00
clutter-id-pool.h
clutter-input-device.c input-device: Do not use weak references with actors 2012-02-13 08:52:08 +00:00
clutter-input-device.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-interval.c docs: Fixes for building the API reference 2011-07-26 13:44:12 +01:00
clutter-interval.h Add deprecated header for ClutterAnimation 2012-02-27 15:38:11 +00:00
clutter-keysyms-table.c clutter/clutter-keysyms-table.c: Fix function name 2011-10-12 17:25:37 +08:00
clutter-keysyms-update.pl Move clutter-keysyms-compat.h to the deprecated section 2011-11-03 14:42:39 +00:00
clutter-keysyms.h Move clutter-keysyms-compat.h to the deprecated section 2011-11-03 14:42:39 +00:00
clutter-layout-manager.c actor: Remove automagic "expand" flag 2012-01-16 23:37:13 +00:00
clutter-layout-manager.h actor: Remove automagic "expand" flag 2012-01-16 23:37:13 +00:00
clutter-layout-meta.c
clutter-layout-meta.h
clutter-list-model.c Mark internal symbol as private 2012-02-09 18:40:03 +00:00
clutter-list-model.h
clutter-macros.h Add flexible versioning scheme 2012-02-27 15:21:31 +00:00
clutter-main.c Add diagnostic mode 2011-12-28 09:37:53 +00:00
clutter-main.h Deprecate some more old, useless API 2011-11-15 17:58:25 +00:00
clutter-marshal.list text: Implement ClutterTextBuffer 2012-01-17 14:29:44 +00:00
clutter-master-clock.c Mark internal symbol as private 2012-02-09 18:40:03 +00:00
clutter-master-clock.h Clean up clutter-timeline.h 2012-02-13 13:39:47 +00:00
clutter-media.c clutter-media: mention the asynchronous behavior of set_playing() in the doc. 2011-07-04 15:58:08 +01:00
clutter-media.h
clutter-model-private.h Mark internal symbol as private 2012-02-09 18:40:03 +00:00
clutter-model.c Mark internal symbol as private 2012-02-09 18:40:03 +00:00
clutter-model.h Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-offscreen-effect-private.h
clutter-offscreen-effect.c Reduce our internal dependence on the Cogl 1.x api 2012-02-21 17:46:11 +00:00
clutter-offscreen-effect.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-page-turn-effect.c
clutter-page-turn-effect.h
clutter-paint-volume-private.h
clutter-paint-volume.c paint-volume: Add a union method for boxes 2012-02-27 11:24:08 +00:00
clutter-path-constraint.c
clutter-path-constraint.h
clutter-path.c Reduce our internal dependence on the Cogl 1.x api 2012-02-21 17:46:11 +00:00
clutter-path.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-private.h Remove use of CoglVector3 2012-01-16 21:06:19 +00:00
clutter-profile.c debug: Clean up profile/debug symbols 2011-11-18 17:44:42 +00:00
clutter-profile.h debug: Clean up profile/debug symbols 2011-11-18 17:44:42 +00:00
clutter-script-parser.c Mark internal symbol as private 2012-02-09 18:40:03 +00:00
clutter-script-private.h Mark internal symbol as private 2012-02-09 18:40:03 +00:00
clutter-script.c script: Add loading from a resource 2012-01-24 12:04:56 +00:00
clutter-script.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-scriptable.c Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-scriptable.h Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-settings-private.h Add more sections to the Clutter configuration file 2011-10-11 17:52:17 +01:00
clutter-settings.c Do not leak strings from GKeyFile 2011-10-11 22:45:14 +01:00
clutter-settings.h
clutter-shader-effect.c Reduce our internal dependence on the Cogl 1.x api 2012-02-21 17:46:11 +00:00
clutter-shader-effect.h clutter-shader-effect: Add a get_static_shader_source virtual 2011-09-30 11:51:37 +01:00
clutter-shader-types.c Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-shader-types.h Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-snap-constraint.c snap-constraint: Fix allocation for CLUTTER_SNAP_EDGE_RIGHT 2011-07-18 13:43:29 +01:00
clutter-snap-constraint.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-stage-manager-private.h
clutter-stage-manager.c stage-manager: Store the stage manager into the main context 2011-11-14 15:43:20 +00:00
clutter-stage-manager.h Add deprecated header for ClutterStageManager 2012-02-27 15:21:32 +00:00
clutter-stage-private.h stage: Add state tracking 2012-01-26 08:30:47 +00:00
clutter-stage-window.c stage-window: Add :backend and :wrapper properties 2011-11-10 14:55:03 +00:00
clutter-stage-window.h Reduce our internal dependence on the Cogl 1.x api 2012-02-21 17:46:11 +00:00
clutter-stage.c ClutterStage: notify "key-focus" change on clutter_stage_emit_key_focus_event 2012-02-14 16:53:54 +01:00
clutter-stage.h Clean up the included headers 2012-02-23 17:21:57 +00:00
clutter-state.c Fixed clutter_state_remove_key_internal() to propagate the is_inert state 2012-02-06 15:42:23 +00:00
clutter-state.h Move more typedefs into clutter-types.h 2011-10-11 17:59:50 +01:00
clutter-swipe-action.c swipe-action: Remove the required devices call 2011-06-10 15:15:15 +01:00
clutter-swipe-action.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-table-layout.c Fix compiler warnings 2012-01-16 23:49:49 +00:00
clutter-table-layout.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-text-buffer.c text-buffer: Fix the Since annotations 2012-01-17 14:29:45 +00:00
clutter-text-buffer.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-text.c Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-text.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-texture.c Clean up the included headers 2012-02-23 17:21:57 +00:00
clutter-texture.h Add a deprecated header for ClutterTexture 2012-02-27 15:44:38 +00:00
clutter-timeline.c Fix the progress function scope annotation 2012-02-23 11:23:15 +00:00
clutter-timeline.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-types.h Annotate all functions available since 1.10 2012-02-27 16:35:09 +00:00
clutter-units.c Eliminate G_CONST_RETURN 2011-06-07 16:06:24 +01:00
clutter-units.h Move all enumerations to a separate file 2011-10-11 17:59:46 +01:00
clutter-util.c Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00
clutter-version.h.in docs: Document the versioning macros 2012-02-27 16:47:53 +00:00
clutter-version.h.win32.in Update clutter-version.h.win32(.in) 2012-02-29 18:10:03 +08:00
clutter.h Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00
clutter.pc.in build: Add infrastructure for inserting Requires.private into pkg-config files 2012-01-11 12:23:46 +00:00
clutter.symbols actor: Add a method for computing the default paint volume 2012-02-27 11:59:57 +00:00
Makefile.am Move clutter-util.h into the deprecated section 2012-02-27 15:56:12 +00:00