mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Add debug option to skip cursor-only updates while VRR is active (#1616)
* Add debug option to skip cursor-only updates while VRR is active * Update niri-config/src/lib.rs Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com> * Update src/backend/tty.rs Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com> * Update wiki/Configuration:-Debug-Options.md Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com> * Update Configuration:-Debug-Options.md * Update tty.rs * Update lib.rs * Update Configuration:-Debug-Options.md --------- Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
This commit is contained in:
@@ -2329,6 +2329,8 @@ pub struct DebugConfig {
|
|||||||
pub strict_new_window_focus_policy: bool,
|
pub strict_new_window_focus_policy: bool,
|
||||||
#[knuffel(child)]
|
#[knuffel(child)]
|
||||||
pub honor_xdg_activation_with_invalid_serial: bool,
|
pub honor_xdg_activation_with_invalid_serial: bool,
|
||||||
|
#[knuffel(child)]
|
||||||
|
pub skip_cursor_only_updates_during_vrr: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(knuffel::DecodeScalar, Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(knuffel::DecodeScalar, Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
@@ -5286,6 +5288,7 @@ mod tests {
|
|||||||
disable_monitor_names: false,
|
disable_monitor_names: false,
|
||||||
strict_new_window_focus_policy: false,
|
strict_new_window_focus_policy: false,
|
||||||
honor_xdg_activation_with_invalid_serial: false,
|
honor_xdg_activation_with_invalid_serial: false,
|
||||||
|
skip_cursor_only_updates_during_vrr: false,
|
||||||
},
|
},
|
||||||
workspaces: [
|
workspaces: [
|
||||||
Workspace {
|
Workspace {
|
||||||
|
|||||||
@@ -1422,6 +1422,12 @@ impl Tty {
|
|||||||
if debug.disable_cursor_plane {
|
if debug.disable_cursor_plane {
|
||||||
flags.remove(FrameFlags::ALLOW_CURSOR_PLANE_SCANOUT);
|
flags.remove(FrameFlags::ALLOW_CURSOR_PLANE_SCANOUT);
|
||||||
}
|
}
|
||||||
|
if debug.skip_cursor_only_updates_during_vrr {
|
||||||
|
let output_state = niri.output_state.get(output).unwrap();
|
||||||
|
if output_state.frame_clock.vrr() {
|
||||||
|
flags.insert(FrameFlags::SKIP_CURSOR_ONLY_UPDATES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flags
|
flags
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ debug {
|
|||||||
disable-monitor-names
|
disable-monitor-names
|
||||||
strict-new-window-focus-policy
|
strict-new-window-focus-policy
|
||||||
honor-xdg-activation-with-invalid-serial
|
honor-xdg-activation-with-invalid-serial
|
||||||
|
skip-cursor-only-updates-during-vrr
|
||||||
}
|
}
|
||||||
|
|
||||||
binds {
|
binds {
|
||||||
@@ -275,6 +276,22 @@ debug {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `skip-cursor-only-updates-during-vrr`
|
||||||
|
|
||||||
|
<sup>Since: next release</sup>
|
||||||
|
|
||||||
|
Skips redrawing the screen from cursor input while variable refresh rate is active.
|
||||||
|
|
||||||
|
Useful for games where the cursor isn't drawn internally to prevent erratic VRR shifts in response to cursor movement.
|
||||||
|
|
||||||
|
Note that the current implementation has some issues, for example when there's nothing redrawing the screen (like a game), the rendering will appear to completely freeze (since cursor movements won't cause redraws).
|
||||||
|
|
||||||
|
```kdl
|
||||||
|
debug {
|
||||||
|
skip-cursor-only-updates-during-vrr
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Key Bindings
|
### Key Bindings
|
||||||
|
|
||||||
These are not debug options, but rather key bindings.
|
These are not debug options, but rather key bindings.
|
||||||
|
|||||||
Reference in New Issue
Block a user