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 <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-03-28 21:41:21 +00:00
parent 357b7df6ab
commit df2a33e8a8
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}