From 1ca01ec456601c503cb130bd9fecb8f62c70d592 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 11 Oct 2019 18:01:13 +0100 Subject: [PATCH] Make sure window cannot enter fading when unredirected 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 #246 Signed-off-by: Yuxuan Shui --- src/event.c | 5 ++++- src/win.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/event.c b/src/event.c index 6de88f8..39a6f6a 100644 --- a/src/event.c +++ b/src/event.c @@ -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)); + } } } diff --git a/src/win.c b/src/win.c index 50c717e..fd247be 100644 --- a/src/win.c +++ b/src/win.c @@ -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)); + } } }