mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
tearing: add 'always' which by default enables tearing for all windows
Closes #2272
This commit is contained in:
parent
f8ed199197
commit
171ad56f34
5 changed files with 17 additions and 4 deletions
|
|
@ -190,18 +190,24 @@ this is for compatibility with Openbox.
|
|||
*fullscreen* enables adaptive sync whenever a window is in fullscreen
|
||||
mode.
|
||||
|
||||
*<core><allowTearing>* [yes|no|fullscreen|fullscreenForced]
|
||||
*<core><allowTearing>* [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,
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ enum tearing_mode {
|
|||
LAB_TEARING_ENABLED,
|
||||
LAB_TEARING_FULLSCREEN,
|
||||
LAB_TEARING_FULLSCREEN_FORCED,
|
||||
LAB_TEARING_ALWAYS,
|
||||
};
|
||||
|
||||
enum tiling_events_mode {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue