Improve transparency detection for blur

Previously, only the WM windows (window manager usually reparents the
application windows under its own window so it can manage them) are
checked for alpha channels. Some of the window managers (e.g. awesome)
acquire alpha channels for all of the WM windows, whether the underlying
application windows have alpha channel or not.

With this change, the application windows are also checked for alpha
channels. If a WM window has alpha but its child doesn't, only the WM
frame will be considered to be semi-transparent. Thus preventing some
unnecessary blurring.

Closes #191

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-07-13 12:29:39 +01:00
parent 7d28309a47
commit 426043baa7
5 changed files with 71 additions and 32 deletions

View File

@ -567,10 +567,10 @@ static struct managed_win *paint_preprocess(session_t *ps, bool *fade_running) {
// fading is enabled, and could create inconsistency when the wallpaper
// is not correctly set.
if (ps->o.unredir_if_possible && is_highest) {
if (win_is_solid(ps, w) &&
(w->frame_opacity == 1 || !win_has_frame(w)) &&
win_is_fullscreen(ps, w) && !w->unredir_if_possible_excluded)
if (w->mode == WMODE_SOLID && !ps->o.force_win_blend &&
win_is_fullscreen(ps, w) && !w->unredir_if_possible_excluded) {
unredir_possible = true;
}
}
w->prev_trans = bottom;