From 492f2045ce09d27abf377a3c35e2bd4e690d7edf Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 30 Jul 2024 13:47:19 +0100 Subject: [PATCH] event: don't set pending update for unmapped windows Their updates will be handled when they are mapped. Signed-off-by: Yuxuan Shui --- src/event.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/event.c b/src/event.c index 553f2fdd31..fbf89b9c2f 100644 --- a/src/event.c +++ b/src/event.c @@ -380,14 +380,14 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) { return; } - add_damage_from_win(ps, w); - - ps->pending_updates |= - win_set_pending_geometry(w, win_geometry_from_configure_notify(ce)); - - // override_redirect flag cannot be changed after window creation, as far - // as I know, so there's no point to re-match windows here. + bool changed = win_set_pending_geometry(w, win_geometry_from_configure_notify(ce)) | + (w->a.override_redirect != ce->override_redirect); w->a.override_redirect = ce->override_redirect; + + if (w->state == WSTATE_MAPPED) { + add_damage_from_win(ps, w); + ps->pending_updates |= changed; + } } static inline void ev_configure_notify(session_t *ps, xcb_configure_notify_event_t *ev) {