Remove the clear-shadow option

Shadows attached to ARGB/transparent windows are always cleared now.
This commit is contained in:
Yuxuan Shui 2018-09-23 23:52:55 +01:00
parent 209b751b25
commit 6f59367c00
5 changed files with 12 additions and 19 deletions

View File

@ -59,9 +59,6 @@ OPTIONS
*-C*, *--no-dock-shadow*:: *-C*, *--no-dock-shadow*::
Avoid drawing shadows on dock/panel windows. Avoid drawing shadows on dock/panel windows.
*-z*, *--clear-shadow*::
Zero the part of the shadow's mask behind the window. Note this may not work properly on ARGB windows with fully transparent areas.
*-f*, *--fading*:: *-f*, *--fading*::
Fade windows in/out when opening/closing and when opacity changes, unless *--no-fading-openclose* is used. Fade windows in/out when opening/closing and when opacity changes, unless *--no-fading-openclose* is used.

View File

@ -625,7 +625,6 @@ typedef struct _options_t {
int shadow_radius; int shadow_radius;
int shadow_offset_x, shadow_offset_y; int shadow_offset_x, shadow_offset_y;
double shadow_opacity; double shadow_opacity;
bool clear_shadow;
/// Geometry of a region in which shadow is not painted on. /// Geometry of a region in which shadow is not painted on.
geometry_t shadow_exclude_reg_geom; geometry_t shadow_exclude_reg_geom;
/// Shadow blacklist. A linked list of conditions. /// Shadow blacklist. A linked list of conditions.

View File

@ -1808,7 +1808,7 @@ paint_all(session_t *ps, XserverRegion region, XserverRegion region_real, win *t
// Clear the shadow here instead of in make_shadow() for saving GPU // Clear the shadow here instead of in make_shadow() for saving GPU
// power and handling shaped windows // power and handling shaped windows
if (ps->o.clear_shadow && w->border_size) if (w->mode != WMODE_SOLID && w->border_size)
XFixesSubtractRegion(ps->dpy, reg_paint, reg_paint, w->border_size); XFixesSubtractRegion(ps->dpy, reg_paint, reg_paint, w->border_size);
#ifdef CONFIG_XINERAMA #ifdef CONFIG_XINERAMA
@ -4037,7 +4037,9 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
case 'e': case 'e':
ps->o.frame_opacity = atof(optarg); ps->o.frame_opacity = atof(optarg);
break; break;
P_CASEBOOL('z', clear_shadow); case 'z':
printf_errf("(): clear-shadow is removed, shadows are automatically cleared now.");
break;
case 'n': case 'n':
case 'a': case 'a':
case 's': case 's':
@ -5159,7 +5161,6 @@ session_init(session_t *ps_old, int argc, char **argv) {
.shadow_offset_x = -15, .shadow_offset_x = -15,
.shadow_offset_y = -15, .shadow_offset_y = -15,
.shadow_opacity = .75, .shadow_opacity = .75,
.clear_shadow = false,
.shadow_blacklist = NULL, .shadow_blacklist = NULL,
.shadow_ignore_shaped = false, .shadow_ignore_shaped = false,
.respect_prop_shadow = false, .respect_prop_shadow = false,

View File

@ -245,8 +245,6 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) {
ps->o.active_opacity = normalize_d(dval) * OPAQUE; ps->o.active_opacity = normalize_d(dval) * OPAQUE;
// -e (frame_opacity) // -e (frame_opacity)
config_lookup_float(&cfg, "frame-opacity", &ps->o.frame_opacity); config_lookup_float(&cfg, "frame-opacity", &ps->o.frame_opacity);
// -z (clear_shadow)
lcfg_lookup_bool(&cfg, "clear-shadow", &ps->o.clear_shadow);
// -c (shadow_enable) // -c (shadow_enable)
if (config_lookup_bool(&cfg, "shadow", &ival) && ival) if (config_lookup_bool(&cfg, "shadow", &ival) && ival)
wintype_arr_enable(ps->o.wintype_shadow); wintype_arr_enable(ps->o.wintype_shadow);

View File

@ -888,6 +888,12 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
return true; \ return true; \
} }
#define cdbus_m_opts_get_stub(tgt, apdarg_func, ret) \
if (!strcmp(MSTR(tgt), target)) { \
apdarg_func(ps, msg, ret); \
return true; \
}
// version // version
if (!strcmp("version", target)) { if (!strcmp("version", target)) {
cdbus_reply_string(ps, msg, COMPTON_VERSION); cdbus_reply_string(ps, msg, COMPTON_VERSION);
@ -948,7 +954,7 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
cdbus_m_opts_get_do(shadow_offset_x, cdbus_reply_int32); cdbus_m_opts_get_do(shadow_offset_x, cdbus_reply_int32);
cdbus_m_opts_get_do(shadow_offset_y, cdbus_reply_int32); cdbus_m_opts_get_do(shadow_offset_y, cdbus_reply_int32);
cdbus_m_opts_get_do(shadow_opacity, cdbus_reply_double); cdbus_m_opts_get_do(shadow_opacity, cdbus_reply_double);
cdbus_m_opts_get_do(clear_shadow, cdbus_reply_bool); cdbus_m_opts_get_stub(clear_shadow, cdbus_reply_bool, true);
cdbus_m_opts_get_do(xinerama_shadow_crop, cdbus_reply_bool); cdbus_m_opts_get_do(xinerama_shadow_crop, cdbus_reply_bool);
cdbus_m_opts_get_do(fade_delta, cdbus_reply_int32); cdbus_m_opts_get_do(fade_delta, cdbus_reply_int32);
@ -1054,16 +1060,8 @@ cdbus_process_opts_set(session_t *ps, DBusMessage *msg) {
} }
// clear_shadow // clear_shadow
if (!strcmp("clear_shadow", target)) { if (!strcmp("clear_shadow", target))
dbus_bool_t val = FALSE;
if (!cdbus_msg_get_arg(msg, 1, DBUS_TYPE_BOOLEAN, &val))
return false;
if (ps->o.clear_shadow != val) {
ps->o.clear_shadow = val;
force_repaint(ps);
}
goto cdbus_process_opts_set_success; goto cdbus_process_opts_set_success;
}
// track_focus // track_focus
if (!strcmp("track_focus", target)) { if (!strcmp("track_focus", target)) {