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:
@@ -715,7 +715,7 @@ win_blur_background(session_t *ps, struct managed_win *w, xcb_render_picture_t t
|
||||
// Minimize the region we try to blur, if the window itself is not
|
||||
// opaque, only the frame is.
|
||||
region_t reg_blur = win_get_bounding_shape_global_by_val(w);
|
||||
if (win_is_solid(ps, w)) {
|
||||
if (w->mode == WMODE_FRAME_TRANS && !ps->o.force_win_blend) {
|
||||
region_t reg_noframe;
|
||||
pixman_region32_init(®_noframe);
|
||||
win_get_region_noframe_local(w, ®_noframe);
|
||||
@@ -895,8 +895,9 @@ void paint_all(session_t *ps, struct managed_win *t, bool ignore_damage) {
|
||||
set_tgt_clip(ps, ®_tmp);
|
||||
// Blur window background
|
||||
if (w->blur_background &&
|
||||
(!win_is_solid(ps, w) ||
|
||||
(ps->o.blur_background_frame && w->frame_opacity != 1)))
|
||||
(w->mode == WMODE_TRANS ||
|
||||
(ps->o.blur_background_frame && w->mode == WMODE_FRAME_TRANS) ||
|
||||
ps->o.force_win_blend))
|
||||
win_blur_background(ps, w, ps->tgt_buffer.pict, ®_tmp);
|
||||
|
||||
// Painting the window
|
||||
|
||||
Reference in New Issue
Block a user