Skip to content

Commit

Permalink
options: remove --respect-prop-shadow
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
yshui committed Oct 22, 2019
1 parent cdcdda8 commit 2d28ab6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
3 changes: 0 additions & 3 deletions man/compton.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 0 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 6 additions & 5 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2d28ab6

Please sign in to comment.