Add per window type option full-shadow
When this option is enabled for a window type, shadow will be drawn in areas that are obscure by the shape of the window. Useful when the given window type has parts of the window transparent, and you want to have shadows in those areas. Fixes #45 Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@ -1915,10 +1915,11 @@ paint_all(session_t *ps, region_t *region, const region_t *region_real, win * co
|
||||
w->g.x + w->shadow_dx, w->g.y + w->shadow_dy,
|
||||
w->shadow_width, w->shadow_height);
|
||||
|
||||
// Mask out the body of the window from the shadow
|
||||
// Mask out the body of the window from the shadow if needed
|
||||
// Doing it here instead of in make_shadow() for saving GPU
|
||||
// power and handling shaped windows (XXX unconfirmed)
|
||||
pixman_region32_subtract(®_tmp, ®_tmp, &bshape);
|
||||
if (!ps->o.wintype_full_shadow[w->window_type])
|
||||
pixman_region32_subtract(®_tmp, ®_tmp, &bshape);
|
||||
|
||||
#ifdef CONFIG_XINERAMA
|
||||
if (ps->o.xinerama_shadow_crop && w->xinerama_scr >= 0 &&
|
||||
@ -4228,6 +4229,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
|
||||
cfgtmp.menu_opacity = normalize_d(cfgtmp.menu_opacity);
|
||||
ps->o.refresh_rate = normalize_i_range(ps->o.refresh_rate, 0, 300);
|
||||
ps->o.alpha_step = normalize_d_range(ps->o.alpha_step, 0.01, 1.0);
|
||||
|
||||
if (shadow_enable)
|
||||
wintype_arr_enable(ps->o.wintype_shadow);
|
||||
ps->o.wintype_shadow[WINTYPE_DESKTOP] = false;
|
||||
@ -4237,6 +4239,7 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
|
||||
ps->o.wintype_shadow[WINTYPE_DND] = false;
|
||||
if (fading_enable)
|
||||
wintype_arr_enable(ps->o.wintype_fade);
|
||||
|
||||
if (!safe_isnan(cfgtmp.menu_opacity)) {
|
||||
ps->o.wintype_opacity[WINTYPE_DROPDOWN_MENU] = cfgtmp.menu_opacity;
|
||||
ps->o.wintype_opacity[WINTYPE_POPUP_MENU] = cfgtmp.menu_opacity;
|
||||
@ -5049,6 +5052,7 @@ session_init(session_t *ps_old, int argc, char **argv) {
|
||||
.vsync_aggressive = false,
|
||||
|
||||
.wintype_shadow = { false },
|
||||
.wintype_full_shadow = { false },
|
||||
.shadow_red = 0.0,
|
||||
.shadow_green = 0.0,
|
||||
.shadow_blue = 0.0,
|
||||
|
Reference in New Issue
Block a user