backend: allow transparent windows to clip other windows

Transparent windows usually blends on top of other windows, this commit
adds an option to make transparent windows clip other windows like
non-transparent windows do.

Closes #265

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-11-30 21:24:22 +00:00
parent 7040579a38
commit 6a3d1354be
6 changed files with 53 additions and 5 deletions

View File

@ -549,10 +549,11 @@ static struct managed_win *paint_preprocess(session_t *ps, bool *fade_running) {
w->reg_ignore = rc_region_ref(last_reg_ignore);
}
// If the window is solid, we add the window region to the
// ignored region
// If the window is solid, or we enabled clipping for transparent windows,
// we add the window region to the ignored region
// Otherwise last_reg_ignore shouldn't change
if (w->mode != WMODE_TRANS && !ps->o.force_win_blend) {
if ((w->mode != WMODE_TRANS && !ps->o.force_win_blend) ||
ps->o.transparent_clipping) {
// w->mode == WMODE_SOLID or WMODE_FRAME_TRANS
region_t *tmp = rc_region_new();
if (w->mode == WMODE_SOLID) {