Make sure only MAPPED state can transition to FADING

win_update_focused transition window into FADING without checking their
current state, resulting into unmapping windows being brought into
FADING state and stops unmapping.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-02-23 00:11:29 +00:00
parent 9cce1efe3f
commit 8d639f41e9
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 7 additions and 1 deletions

View File

@ -970,8 +970,14 @@ void win_update_focused(session_t *ps, win *w) {
// Always recalculate the window target opacity, since some opacity-related
// options depend on the output value of win_is_focused_real() instead of
// w->focused
double opacity_tgt_old = w->opacity_tgt;
w->opacity_tgt = win_calc_opacity_target(ps, w);
if (opacity_tgt_old != w->opacity_tgt && w->state == WSTATE_MAPPED) {
// Only MAPPED can transition to FADING
assert(w->state != WSTATE_DESTROYING && w->state != WSTATE_UNMAPPING &&
w->state != WSTATE_UNMAPPED);
w->state = WSTATE_FADING;
}
}
/**