From df2a33e8a85aa26a5473731509fdef914c1eef76 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 28 Mar 2019 21:41:21 +0000 Subject: [PATCH] core: fix a case where closed window is left on screen If a window is unmapped, then mapped to a different position on screen before fade out is completed (when fading is not enabled, it has to be mapped again in the same frame), the old window content is left on screen. This is because when this happens, we didn't add the unmapping window to damage. Signed-off-by: Yuxuan Shui --- src/win.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/win.c b/src/win.c index b4c06c4..14f55a8 100644 --- a/src/win.c +++ b/src/win.c @@ -1577,6 +1577,7 @@ void win_skip_fading(session_t *ps, win **_w) { assert(w->opacity_tgt == w->opacity); return; } + log_trace("Skipping fading process of window %#010x (%s)", w->id, w->name); w->opacity = w->opacity_tgt; win_check_fade_finished(ps, _w); } @@ -1632,6 +1633,9 @@ void map_win(session_t *ps, win *w) { if (w->state == WSTATE_UNMAPPING) { win_skip_fading(ps, &w); + // We skipped the unmapping process, the window was rendered, now it is + // not anymore. So we need to mark then unmapping window as damaged. + add_damage_from_win(ps, w); assert(w); }