Don't start fading when screen is unredirected

If a window is destroyed and starts to fade out when screen is
unredirected, when the screen become redirected again, we will generate
errors when trying to render that window.

Also make sure the assumption that all window are either MAPPED or
UNMAPPED when screen is unredirected holds.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-21 02:12:07 +00:00
parent 9aaf0fc707
commit ff37cf9756
3 changed files with 31 additions and 11 deletions

View File

@ -2018,11 +2018,7 @@ redir_stop(session_t *ps) {
for (win *w = ps->list, *next; w; w = next) {
next = w->next;
// Wrapping up fading in progress
if (w->opacity != w->opacity_tgt) {
assert(w->state != WSTATE_UNMAPPED && w->state != WSTATE_MAPPED);
w->opacity = w->opacity_tgt;
win_check_fade_finished(ps, &w);
}
win_skip_fading(ps, &w);
// `w` might be freed by win_check_fade_finished
if (!w) {