diff --git a/dbus-examples/cdbus-driver.sh b/dbus-examples/cdbus-driver.sh index 157ac74..6215816 100755 --- a/dbus-examples/cdbus-driver.sh +++ b/dbus-examples/cdbus-driver.sh @@ -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" diff --git a/src/compton.c b/src/compton.c index d2b1f4c..cf6ebb8 100644 --- a/src/compton.c +++ b/src/compton.c @@ -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; } diff --git a/src/win.c b/src/win.c index faf6c6d..96833a4 100644 --- a/src/win.c +++ b/src/win.c @@ -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 } }