[mutter] Don't restack windows while we are unmanaging them
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Don't restack windows while we are unmanaging them
- Date: Tue, 16 Sep 2014 17:45:27 +0000 (UTC)
commit 21f123c69fadd5d117829255ca28bc4a8051fb72
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Tue Sep 16 13:40:30 2014 -0400
Don't restack windows while we are unmanaging them
Restacking the frame for a window while unmanaging the window is
harmless, but for undecorated (in particular, client-side-decorated)
windows, this causes problems because the window is typically
destroyed by the client immediately after withredrawing the window.
Skip windows flagged as being unmanaged when assembling the new
stack and when comparing the old order to the new stack.
Add a stacking test for this.
src/core/stack-tracker.c | 5 ++-
src/core/stack.c | 3 ++
src/tests/stacking/client-side-decorated.metatest | 22 +++++++++++++++++++++
3 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
index 5dbac54..ebb5903 100644
--- a/src/core/stack-tracker.c
+++ b/src/core/stack-tracker.c
@@ -1063,7 +1063,8 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
for (old_pos = n_windows - 1; old_pos >= 0; old_pos--)
{
MetaWindow *old_window = meta_display_lookup_stack_id (tracker->screen->display, windows[old_pos]);
- if ((old_window && !old_window->override_redirect) || windows[old_pos] ==
tracker->screen->guard_window)
+ if ((old_window && !old_window->override_redirect && !old_window->unmanaging) ||
+ windows[old_pos] == tracker->screen->guard_window)
break;
}
g_assert (old_pos >= 0);
@@ -1093,7 +1094,7 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
}
MetaWindow *old_window = meta_display_lookup_stack_id (tracker->screen->display, windows[old_pos]);
- if (!old_window || old_window->override_redirect)
+ if (!old_window || old_window->override_redirect || old_window->unmanaging)
{
old_pos--;
continue;
diff --git a/src/core/stack.c b/src/core/stack.c
index a9c80b6..15ea826 100644
--- a/src/core/stack.c
+++ b/src/core/stack.c
@@ -1069,6 +1069,9 @@ stack_sync_to_xserver (MetaStack *stack)
Window top_level_window;
guint64 stack_id;
+ if (w->unmanaging)
+ continue;
+
meta_topic (META_DEBUG_STACK, "%u:%d - %s ",
w->layer, w->stack_position, w->desc);
diff --git a/src/tests/stacking/client-side-decorated.metatest
b/src/tests/stacking/client-side-decorated.metatest
new file mode 100644
index 0000000..1d5dfc6
--- /dev/null
+++ b/src/tests/stacking/client-side-decorated.metatest
@@ -0,0 +1,22 @@
+new_client 1 x11
+create 1/1
+show 1/1
+create 1/2 csd
+show 1/2
+wait
+assert_stacking 1/1 1/2
+
+destroy 1/2
+wait
+assert_stacking 1/1
+
+create 1/2 csd
+show 1/2
+create 1/3 csd
+show 1/3
+wait
+assert_stacking 1/1 1/2 1/3
+
+destroy 1/2
+wait
+assert_stacking 1/1 1/3
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]