From 2d28ab6032708b8f04a455ac2bc538ea09c1f204 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Tue, 22 Oct 2019 20:44:59 +0100 Subject: [PATCH] options: remove --respect-prop-shadow A quick search on GitHub showing the _COMPTON_SHADOW is actively being used (most noteably, by polybar). It is not a difficult thing to support, and it doesn't have that much runtime overhead. So remove the option that guards this feature, make it enabled by default. (Side note, I saw lots of people putting this option in their config files, but this is actually a command line only option.) Signed-off-by: Yuxuan Shui --- man/compton.1.asciidoc | 3 --- src/config.c | 1 - src/config.h | 2 -- src/event.c | 2 +- src/options.c | 11 ++++++----- src/win.c | 6 ++---- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/man/compton.1.asciidoc b/man/compton.1.asciidoc index aecfdaf..59c05ea 100644 --- a/man/compton.1.asciidoc +++ b/man/compton.1.asciidoc @@ -139,9 +139,6 @@ OPTIONS *--use-ewmh-active-win*:: Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, provided that the WM supports it. -*--respect-prop-shadow*:: - Respect '_COMPTON_SHADOW'. This a prototype-level feature, which you must not rely on. - *--unredir-if-possible*:: Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows. Known to cause flickering when redirecting/unredirecting windows. *--paint-on-overlay* may make the flickering less obvious. diff --git a/src/config.c b/src/config.c index 7906423..c43ff0f 100644 --- a/src/config.c +++ b/src/config.c @@ -524,7 +524,6 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable, .shadow_opacity = .75, .shadow_blacklist = NULL, .shadow_ignore_shaped = false, - .respect_prop_shadow = false, .xinerama_shadow_crop = false, .fade_in_step = 0.028, diff --git a/src/config.h b/src/config.h index c1ab8af..eb29437 100644 --- a/src/config.h +++ b/src/config.h @@ -149,8 +149,6 @@ typedef struct options { c2_lptr_t *shadow_blacklist; /// Whether bounding-shaped window should be ignored. bool shadow_ignore_shaped; - /// Whether to respect _COMPTON_SHADOW. - bool respect_prop_shadow; /// Whether to crop shadow to the very Xinerama screen. bool xinerama_shadow_crop; diff --git a/src/event.c b/src/event.c index 39a6f6a..b5cbf64 100644 --- a/src/event.c +++ b/src/event.c @@ -516,7 +516,7 @@ static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t } // If _COMPTON_SHADOW changes - if (ps->o.respect_prop_shadow && ps->atoms->a_COMPTON_SHADOW == ev->atom) { + if (ps->atoms->a_COMPTON_SHADOW == ev->atom) { auto w = find_managed_win(ps, ev->window); if (w) { win_update_prop_shadow(ps, w); diff --git a/src/options.c b/src/options.c index 8061fcd..7ea485e 100644 --- a/src/options.c +++ b/src/options.c @@ -168,10 +168,6 @@ static void usage(int ret) { " Use _NET_WM_ACTIVE_WINDOW on the root window to determine which\n" " window is focused instead of using FocusIn/Out events.\n" "\n" - "--respect-prop-shadow\n" - " Respect _COMPTON_SHADOW. This a prototype-level feature, which\n" - " you must not rely on.\n" - "\n" "--unredir-if-possible\n" " Unredirect all windows if a full-screen opaque window is\n" " detected, to maximize performance for full-screen windows.\n" @@ -635,7 +631,12 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, " from the command line options"); break; P_CASEBOOL(276, use_ewmh_active_win); - P_CASEBOOL(277, respect_prop_shadow); + case 277: + // --respect-prop-shadow + log_warn("--respect-prop-shadow option has been deprecated, its " + "functionality will always be enabled. Please remove it " + "from the command line options"); + break; P_CASEBOOL(278, unredir_if_possible); case 279: // --focus-exclude diff --git a/src/win.c b/src/win.c index d0be605..7f52cde 100644 --- a/src/win.c +++ b/src/win.c @@ -738,7 +738,7 @@ static void win_determine_shadow(session_t *ps, struct managed_win *w) { !w->rounded_corners) { log_debug("Shadow disabled by shadow-ignore-shaped"); shadow_new = false; - } else if (ps->o.respect_prop_shadow && w->prop_shadow == 0) { + } else if (w->prop_shadow == 0) { log_debug("Shadow disabled by shadow property"); shadow_new = false; } @@ -2080,9 +2080,7 @@ void map_win_start(session_t *ps, struct managed_win *w) { win_update_opacity_prop(ps, w); // Check for _COMPTON_SHADOW - if (ps->o.respect_prop_shadow) { - win_update_prop_shadow_raw(ps, w); - } + win_update_prop_shadow_raw(ps, w); // Many things above could affect shadow win_determine_shadow(ps, w);