New backends: smoothly fade blur-texture on fade-in/-out

* Add new field `opacity_target_old` to `struct managed_win` for
tracking relevant `opacity_target` changes.
* Smoothly fade blur-texture opacity on window opacity changes (based on
window opacity), when the window was or will be fully transparent
(`w->opacity ~< 0.004`).
* Fixed alpha-clipping of the blur-texture when using `inactive-opacity` or
repeatedly setting window opacity with large fade intervals (should fix #314).
This commit is contained in:
Bernd Busse
2019-12-20 20:17:38 +01:00
committed by Yuxuan Shui
parent 32754b0262
commit ad8632b017
5 changed files with 84 additions and 25 deletions

View File

@ -482,14 +482,7 @@ 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;
}
if (!ps->redirected) {
CHECK(!win_skip_fading(ps, w));
}
win_update_opacity_target(ps, w);
}
}