Skip to content

Commit

Permalink
Make sure window cannot enter fading when unredirected
Browse files Browse the repository at this point in the history
Firstly, this breaks the assumption that when we redirect the screen,
all window is either mapped or unmapped, causing a assertion failure.

Secondly, if transition window into fading when the screen is not
redirected, the fading will not progress until the screen is redirected,
probably not the desired result.

Fixes chjj#246

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
  • Loading branch information
yshui committed Oct 11, 2019
1 parent 93f0d80 commit 1ca01ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,14 @@ static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t
win_update_opacity_prop(ps, w);
// we cannot receive OPACITY change when window is destroyed
assert(w->state != WSTATE_DESTROYING);
w->opacity_target = win_calc_opacity_target(ps, w, false);
if (w->state == WSTATE_MAPPED) {
// See the winstate_t transition table
w->state = WSTATE_FADING;
}
w->opacity_target = win_calc_opacity_target(ps, w, false);
if (!ps->redirected) {
CHECK(!win_skip_fading(ps, w));
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ static void win_update_focused(session_t *ps, struct managed_win *w) {
if (opacity_target_old != w->opacity_target && w->state == WSTATE_MAPPED) {
// Only MAPPED can transition to FADING
w->state = WSTATE_FADING;
if (!ps->redirected) {
CHECK(!win_skip_fading(ps, w));
}
}
}

Expand Down

0 comments on commit 1ca01ec

Please sign in to comment.