Update comments about clear-shadow

This commit is contained in:
Yuxuan Shui 2018-09-24 00:13:08 +01:00
parent 6f59367c00
commit 4da626639f
3 changed files with 15 additions and 44 deletions

View File

@ -41,12 +41,6 @@ else
echo "Cannot find focused window." echo "Cannot find focused window."
fi fi
# Set the clear_shadow setting to true
dbus-send --print-reply --dest="$service" "$object" "${interface}.opts_set" string:clear_shadow boolean:true
# Get the clear_shadow setting
dbus-send --print-reply --dest="$service" "$object" "${interface}.opts_get" string:clear_shadow
# Reset compton # Reset compton
sleep 3 sleep 3
dbus-send --print-reply --dest="$service" "$object" "${interface}.reset" dbus-send --print-reply --dest="$service" "$object" "${interface}.reset"

View File

@ -532,20 +532,18 @@ make_shadow(session_t *ps, double opacity,
* center (fill the complete data array) * center (fill the complete data array)
*/ */
// If clear_shadow is enabled and the border & corner shadow (which // XXX If the center part of the shadow would be entirely covered by
// later will be filled) could entirely cover the area of the shadow // the body of the window, we shouldn't need to fill the center here.
// that will be displayed, do not bother filling other pixels. If it // XXX In general, we want to just fill the part that is not behind
// can't, we must fill the other pixels here. // the window, in order to reduce CPU load and make transparent window
/* if (!(clear_shadow && ps->o.shadow_offset_x <= 0 && ps->o.shadow_offset_x >= -ps->cgsize // look correct
&& ps->o.shadow_offset_y <= 0 && ps->o.shadow_offset_y >= -ps->cgsize)) { */ if (ps->cgsize > 0) {
if (ps->cgsize > 0) { d = ps->shadow_top[opacity_int * (ps->cgsize + 1) + ps->cgsize];
d = ps->shadow_top[opacity_int * (ps->cgsize + 1) + ps->cgsize]; } else {
} else { d = sum_gaussian(ps->gaussian_map,
d = sum_gaussian(ps->gaussian_map, opacity, center, center, width, height);
opacity, center, center, width, height); }
} memset(data, d, sheight * swidth);
memset(data, d, sheight * swidth);
// }
/* /*
* corners * corners
@ -608,24 +606,6 @@ make_shadow(session_t *ps, double opacity,
} }
} }
/*
if (clear_shadow) {
// Clear the region in the shadow that the window would cover based
// on shadow_offset_{x,y} user provides
int xstart = normalize_i_range(- (int) ps->o.shadow_offset_x, 0, swidth);
int xrange = normalize_i_range(width - (int) ps->o.shadow_offset_x,
0, swidth) - xstart;
int ystart = normalize_i_range(- (int) ps->o.shadow_offset_y, 0, sheight);
int yend = normalize_i_range(height - (int) ps->o.shadow_offset_y,
0, sheight);
int y;
for (y = ystart; y < yend; y++) {
memset(&data[y * swidth + xstart], 0, xrange);
}
}
*/
return ximage; return ximage;
} }

View File

@ -407,12 +407,9 @@ void win_update_shape(session_t *ps, win *w) {
win_on_factor_change(ps, w); win_on_factor_change(ps, w);
/* // XXX Window shape changed, and if we didn't fill in the pixels
// If clear_shadow state on the window possibly changed, destroy the old // behind the window (not implemented yet), we should rebuild
// shadow_pict // the shadow_pict
if (ps->o.clear_shadow && w->bounding_shaped != bounding_shaped_old)
free_paint(ps, &w->shadow_paint);
*/
} }
} }