From a5e3de4489ce33726516809e172e9ae5e018334c Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Wed, 27 Mar 2024 00:34:31 +0000 Subject: [PATCH] event: fix damage not being added after changing window stack order Signed-off-by: Yuxuan Shui --- src/event.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/event.c b/src/event.c index 072f833b..afaa5ac3 100644 --- a/src/event.c +++ b/src/event.c @@ -226,14 +226,14 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) { return; } + wm_stack_move_above(ps->wm, w, ce->above_sibling); + if (!w->managed) { - wm_stack_move_above(ps->wm, w, ce->above_sibling); return; } auto mw = (struct managed_win *)w; - - wm_stack_move_above(ps->wm, w, ce->above_sibling); + add_damage_from_win(ps, mw); // We check against pending_g here, because there might have been multiple // configure notifies in this cycle, or the window could receive multiple updates @@ -410,6 +410,9 @@ static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t log_debug("Restack %#010x (%s) to top", old_w->id, win_get_name_if_managed(old_w)); wm_stack_move_to_top(ps->wm, old_w); + if (old_w->managed) { + add_damage_from_win(ps, win_as_managed(old_w)); + } } return; } @@ -489,6 +492,9 @@ static inline void ev_circulate_notify(session_t *ps, xcb_circulate_notify_event } else { wm_stack_move_to_bottom(ps->wm, w); } + if (w->managed) { + add_damage_from_win(ps, win_as_managed(w)); + } } static inline void expose_root(session_t *ps, const rect_t *rects, int nrects) {