]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Fix stacking order
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 4 Aug 2011 20:19:30 +0000 (22:19 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 4 Aug 2011 20:19:30 +0000 (22:19 +0200)
The commit 192dbdabd6ab02d1afb994a73ba389eacaae8c95 introduced a regression
here (open three floating windows and try to raise them with clicking to see
what i mean)

src/x.c

diff --git a/src/x.c b/src/x.c
index f231d7fbb4a3e31ac50a76fd509434031278e436..f4ebc207f791fd39a5bacedceee06b5ffdfe2a7b 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -765,6 +765,7 @@ void x_push_changes(Con *con) {
     }
     //DLOG("Done, EnterNotify disabled\n");
     bool order_changed = false;
+    bool stacking_changed = false;
 
     /* count first, necessary to (re)allocate memory for the bottom-to-top
      * stack afterwards */
@@ -788,8 +789,10 @@ void x_push_changes(Con *con) {
         //DLOG("stack: 0x%08x\n", state->id);
         con_state *prev = CIRCLEQ_PREV(state, state);
         con_state *old_prev = CIRCLEQ_PREV(state, old_state);
-        if ((prev != old_prev || state->initial) && prev != CIRCLEQ_END(&state_head)) {
+        if (prev != old_prev)
             order_changed = true;
+        if ((state->initial || order_changed) && prev != CIRCLEQ_END(&state_head)) {
+            stacking_changed = true;
             DLOG("Stacking 0x%08x above 0x%08x\n", prev->id, state->id);
             uint32_t mask = 0;
             mask |= XCB_CONFIG_WINDOW_SIBLING;
@@ -803,7 +806,7 @@ void x_push_changes(Con *con) {
 
     /* If we re-stacked something (or a new window appeared), we need to update
      * the _NET_CLIENT_LIST_STACKING hint */
-    if (order_changed)
+    if (stacking_changed)
         ewmh_update_client_list_stacking(btt_stack, btt_stack_num);
 
     //DLOG("Re-enabling EnterNotify\n");