From f5abccb29ce0c1a9fbe9601583a247dbb8c83144 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Wed, 6 Mar 2024 02:30:52 +0000 Subject: [PATCH] event: add damage for reparented windows See code comments for details. Fixes #1081 Signed-off-by: Yuxuan Shui --- src/event.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/event.c b/src/event.c index 034a4b75..ff4086b1 100644 --- a/src/event.c +++ b/src/event.c @@ -353,6 +353,16 @@ static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t if (!ret && w->managed) { auto mw = (struct managed_win *)w; CHECK(win_skip_fading(ps, mw)); + // Usually, damage for unmapped windows + // are added in `paint_preprocess`, when + // a window was painted before and isn't + // anymore. But since we are reparenting + // the window here, we would lose track + // of the `to_paint` information. So we + // just add damage here. + if (mw->to_paint) { + add_damage_from_win(ps, mw); + } } } }