From 81d137a3cc645c914ba5d9d41258856cfccd2180 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 21 Jan 2024 17:27:05 +0000 Subject: [PATCH] core: fix debug window check in paint_preprocess Fixes #704 Signed-off-by: Yuxuan Shui --- src/event.c | 5 +++++ src/picom.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/event.c b/src/event.c index 739540d..355aa33 100644 --- a/src/event.c +++ b/src/event.c @@ -270,6 +270,11 @@ static inline void ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t * if (w != NULL) { auto _ attr_unused = destroy_win_start(ps, w); } else if (mw != NULL) { + // XXX the hope here is the WM will destroy the frame window + // quickly after the client window is destroyed. Otherwise a + // frame window without a client window would linger around. Who + // knows what kind of bugs it could cause. This has caused at + // least one: #704 win_unmark_client(ps, mw); win_set_flags(mw, WIN_FLAGS_CLIENT_STALE); ps->pending_updates = true; diff --git a/src/picom.c b/src/picom.c index 8687c2f..ed79aec 100644 --- a/src/picom.c +++ b/src/picom.c @@ -980,8 +980,9 @@ static bool paint_preprocess(session_t *ps, bool *fade_running, bool *animation, if (w->state == WSTATE_UNMAPPED) { log_trace("|- is unmapped"); to_paint = false; - } else if (unlikely(w->base.id == ps->debug_window || - w->client_win == ps->debug_window)) { + } else if (unlikely(ps->debug_window != XCB_NONE) && + (w->base.id == ps->debug_window || + w->client_win == ps->debug_window)) { log_trace("|- is the debug window"); to_paint = false; } else if (!w->ever_damaged && w->state != WSTATE_UNMAPPING &&