From 889844b004a5fd8ce032ea2f7c38f6ed4e5c4363 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 12 Mar 2013 17:01:51 +0100 Subject: [PATCH] Compositor: sync stacking of window actors even if they're not parented to the window groups Window actors might be temporarily parented to intermediate actors during effect, but we should not require that the plugin keeps track of stacking. Rather, assume that the intermediate groups holds a whole stack, and applying position within it. https://bugzilla.gnome.org/show_bug.cgi?id=695711 --- src/compositor/compositor.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 20cbde4c6..fcc9a0057 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -1095,13 +1095,17 @@ sync_actor_stacking (MetaCompScreen *info) } /* reorder the actors by lowering them in turn to the bottom of the stack. - * windows first, then background */ + * windows first, then background. + * + * We reorder the actors even if they're not parented to the window group, + * to allow stacking to work with intermediate actors (eg during effects) + */ for (tmp = g_list_last (info->windows); tmp != NULL; tmp = tmp->prev) { - ClutterActor *actor = tmp->data; + ClutterActor *actor = tmp->data, *parent; - if (clutter_actor_get_parent (actor) == info->window_group) - clutter_actor_set_child_below_sibling (info->window_group, actor, NULL); + parent = clutter_actor_get_parent (actor); + clutter_actor_set_child_below_sibling (parent, actor, NULL); } /* we prepended the backgrounds above so the last actor in the list @@ -1109,10 +1113,10 @@ sync_actor_stacking (MetaCompScreen *info) */ for (tmp = backgrounds; tmp != NULL; tmp = tmp->next) { - ClutterActor *actor = tmp->data; + ClutterActor *actor = tmp->data, *parent; - if (clutter_actor_get_parent (actor) == info->window_group) - clutter_actor_set_child_below_sibling (info->window_group, actor, NULL); + parent = clutter_actor_get_parent (actor); + clutter_actor_set_child_below_sibling (parent, actor, NULL); } g_list_free (backgrounds); }