diff --git a/src/picom.c b/src/picom.c index e781076..d2a7820 100644 --- a/src/picom.c +++ b/src/picom.c @@ -713,7 +713,12 @@ static struct managed_win *paint_preprocess(session_t *ps, bool *fade_running) { unlikely(w->base.id == ps->debug_window || w->client_win == ps->debug_window)) { to_paint = false; - } else if (!w->ever_damaged) { + } else if (!w->ever_damaged && w->state != WSTATE_UNMAPPING && + w->state != WSTATE_DESTROYING) { + // Unmapping clears w->ever_damaged, but the fact that the window + // is fading out means it must have been damaged when it was still + // mapped (because unmap_win_start will skip fading if it wasn't), + // so we still need to paint it. log_trace("Window %#010x (%s) will not be painted because it has " "not received any damages", w->base.id, w->name); diff --git a/src/win.c b/src/win.c index bf8a502..2d54173 100644 --- a/src/win.c +++ b/src/win.c @@ -1978,7 +1978,6 @@ void win_ev_stop(session_t *ps, const struct win *w) { /// Finish the unmapping of a window (e.g. after fading has finished). /// Doesn't free `w` static void unmap_win_finish(session_t *ps, struct managed_win *w) { - w->ever_damaged = false; w->reg_ignore_valid = false; w->state = WSTATE_UNMAPPED; @@ -2234,6 +2233,8 @@ void unmap_win_start(session_t *ps, struct managed_win *w) { assert(false); } + w->ever_damaged = false; + if (unlikely(w->state == WSTATE_UNMAPPING || w->state == WSTATE_UNMAPPED)) { if (win_check_flags_all(w, WIN_FLAGS_MAPPED)) { // Clear the pending map as this window is now unmapped