From 60bdf8786218ce3a15081ba80dcfaf4c2ad62cfb Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 11 Jul 2010 23:41:02 +0200 Subject: [PATCH] Bugfix: Push all following window stacking orders to X11 when the order of a single pair changed --- src/x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/x.c b/src/x.c index 9df33e51..8e879993 100644 --- a/src/x.c +++ b/src/x.c @@ -293,12 +293,15 @@ void x_push_changes(Con *con) { x_push_node(con); LOG("-- PUSHING WINDOW STACK --\n"); + bool order_changed = false; /* X11 correctly represents the stack if we push it from bottom to top */ CIRCLEQ_FOREACH_REVERSE(state, &state_head, state) { LOG("stack: 0x%08x\n", state->id); con_state *prev = CIRCLEQ_PREV(state, state); con_state *old_prev = CIRCLEQ_PREV(state, old_state); - if ((state->initial || prev != old_prev) && prev != CIRCLEQ_END(&state_head)) { + if (prev != old_prev) + order_changed = true; + if ((state->initial || order_changed) && prev != CIRCLEQ_END(&state_head)) { state->initial = false; LOG("Stacking 0x%08x above 0x%08x\n", prev->id, state->id); uint32_t mask = 0;