1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

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*::
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*::
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_offset_x, shadow_offset_y;
double shadow_opacity;
bool clear_shadow;
/// Geometry of a region in which shadow is not painted on.
geometry_t shadow_exclude_reg_geom;
/// 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
// 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);
#ifdef CONFIG_XINERAMA
@ -4037,7 +4037,9 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
case 'e':
ps->o.frame_opacity = atof(optarg);
break;
P_CASEBOOL('z', clear_shadow);
case 'z':
printf_errf("(): clear-shadow is removed, shadows are automatically cleared now.");
break;
case 'n':
case 'a':
case 's':
@ -5159,7 +5161,6 @@ session_init(session_t *ps_old, int argc, char **argv) {
.shadow_offset_x = -15,
.shadow_offset_y = -15,
.shadow_opacity = .75,
.clear_shadow = false,
.shadow_blacklist = NULL,
.shadow_ignore_shaped = 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;
// -e (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)
if (config_lookup_bool(&cfg, "shadow", &ival) && ival)
wintype_arr_enable(ps->o.wintype_shadow);

View file

@ -888,6 +888,12 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
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
if (!strcmp("version", target)) {
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_y, cdbus_reply_int32);
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(fade_delta, cdbus_reply_int32);
@ -1054,16 +1060,8 @@ cdbus_process_opts_set(session_t *ps, DBusMessage *msg) {
}
// clear_shadow
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);
}
if (!strcmp("clear_shadow", target))
goto cdbus_process_opts_set_success;
}
// track_focus
if (!strcmp("track_focus", target)) {