diff --git a/docs/labwc-config.5.scd b/docs/labwc-config.5.scd index 9d469dde..3090302c 100644 --- a/docs/labwc-config.5.scd +++ b/docs/labwc-config.5.scd @@ -190,18 +190,24 @@ this is for compatibility with Openbox. *fullscreen* enables adaptive sync whenever a window is in fullscreen mode. -** [yes|no|fullscreen|fullscreenForced] +** [yes|no|fullscreen|fullscreenForced|always] Allow tearing to reduce input lag. Default is no. *yes* allows tearing if requested by the active window. + *no* tearing is disabled completely. + *fullscreen* allows tearing if requested by the active window, but only when the window is in fullscreen mode. *fullscreenForced* enables tearing whenever the active window is in fullscreen mode, whether or not the application has requested tearing. - Use the *ToggleTearing* action for forcefully enable tearing. + *always* enable tearing for all windows by default, ignoring application + requests. The ToggleTearing action may be used to disable tearing. + + Use the *ToggleTearing* action to forcefully enable / disable tearing + for the active window. Has no effect when allowTearing is set to no. Note: Enabling this option with atomic mode setting is experimental. If you experience undesirable side effects when tearing is allowed, diff --git a/include/config/rcxml.h b/include/config/rcxml.h index dd237fa4..a5bc7fd0 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -36,6 +36,7 @@ enum tearing_mode { LAB_TEARING_ENABLED, LAB_TEARING_FULLSCREEN, LAB_TEARING_FULLSCREEN_FORCED, + LAB_TEARING_ALWAYS, }; enum tiling_events_mode { diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 3951c72f..de4e6fcc 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -954,6 +954,8 @@ set_tearing_mode(const char *str, enum tearing_mode *variable) *variable = LAB_TEARING_FULLSCREEN; } else if (!strcasecmp(str, "fullscreenForced")) { *variable = LAB_TEARING_FULLSCREEN_FORCED; + } else if (!strcasecmp(str, "always")) { + *variable = LAB_TEARING_ALWAYS; } else if (parse_bool(str, -1) == 1) { *variable = LAB_TEARING_ENABLED; } else { @@ -1447,7 +1449,7 @@ rcxml_init(void) rc.gap = 0; rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED; - rc.allow_tearing = false; + rc.allow_tearing = LAB_TEARING_DISABLED; rc.reuse_output_mode = false; rc.xwayland_persistence = false; diff --git a/src/output.c b/src/output.c index 0ab1d28d..393361f6 100644 --- a/src/output.c +++ b/src/output.c @@ -50,7 +50,7 @@ output_get_tearing_allowance(struct output *output) } /* allow tearing for any window when requested or forced */ - if (rc.allow_tearing == LAB_TEARING_ENABLED) { + if (rc.allow_tearing == LAB_TEARING_ENABLED || rc.allow_tearing == LAB_TEARING_ALWAYS) { if (view->force_tearing == LAB_STATE_UNSPECIFIED) { return view->tearing_hint; } else { diff --git a/src/view.c b/src/view.c index d64fddad..92a31b90 100644 --- a/src/view.c +++ b/src/view.c @@ -2474,6 +2474,10 @@ view_init(struct view *view) wl_signal_init(&view->events.minimized); wl_signal_init(&view->events.fullscreened); wl_signal_init(&view->events.activated); + + if (rc.allow_tearing == LAB_TEARING_ALWAYS) { + view->force_tearing = LAB_STATE_ENABLED; + } } void