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."
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
sleep 3
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)
*/
// If clear_shadow is enabled and the border & corner shadow (which
// later will be filled) could entirely cover the area of the shadow
// that will be displayed, do not bother filling other pixels. If it
// can't, we must fill the other pixels here.
/* if (!(clear_shadow && ps->o.shadow_offset_x <= 0 && ps->o.shadow_offset_x >= -ps->cgsize
&& ps->o.shadow_offset_y <= 0 && ps->o.shadow_offset_y >= -ps->cgsize)) { */
if (ps->cgsize > 0) {
d = ps->shadow_top[opacity_int * (ps->cgsize + 1) + ps->cgsize];
} else {
d = sum_gaussian(ps->gaussian_map,
opacity, center, center, width, height);
}
memset(data, d, sheight * swidth);
// }
// XXX If the center part of the shadow would be entirely covered by
// the body of the window, we shouldn't need to fill the center here.
// XXX In general, we want to just fill the part that is not behind
// the window, in order to reduce CPU load and make transparent window
// look correct
if (ps->cgsize > 0) {
d = ps->shadow_top[opacity_int * (ps->cgsize + 1) + ps->cgsize];
} else {
d = sum_gaussian(ps->gaussian_map,
opacity, center, center, width, height);
}
memset(data, d, sheight * swidth);
/*
* 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;
}

View File

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