From f1894f6f9a7470b8b1493cf96b28a48e8a704636 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 22 Aug 2024 18:58:07 +1000 Subject: feature: add on-demand vrr (#586) * feature: add on-demand vrr * Don't require connector::Info in try_to_set_vrr * Improve VRR help message * Rename connector_handle => connector * Fix tracy span name * Move on demand vrr flag set higher * wiki: Mention on-demand VRR --------- Co-authored-by: Ivan Molodetskikh --- wiki/Configuration:-Outputs.md | 11 ++++++++++- wiki/Configuration:-Window-Rules.md | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'wiki') diff --git a/wiki/Configuration:-Outputs.md b/wiki/Configuration:-Outputs.md index eef06fef..f7b3adf8 100644 --- a/wiki/Configuration:-Outputs.md +++ b/wiki/Configuration:-Outputs.md @@ -12,7 +12,7 @@ output "eDP-1" { scale 2.0 transform "90" position x=1280 y=0 - variable-refresh-rate + variable-refresh-rate // on-demand=true background-color "#003300" } @@ -147,6 +147,15 @@ output "HDMI-A-1" { } ``` +Since: 0.1.9 You can also set the `on-demand=true` property, which will only enable VRR when this output shows a window matching the `variable-refresh-rate` window rule. +This is helpful to avoid various issues with VRR, since it can be disabled most of the time, and only enabled for specific windows, like games or video players. + +```kdl +output "HDMI-A-1" { + variable-refresh-rate on-demand=true +} +``` + ### `background-color` Since: 0.1.8 diff --git a/wiki/Configuration:-Window-Rules.md b/wiki/Configuration:-Window-Rules.md index 3daceb15..b13b4661 100644 --- a/wiki/Configuration:-Window-Rules.md +++ b/wiki/Configuration:-Window-Rules.md @@ -47,6 +47,7 @@ window-rule { opacity 0.5 block-out-from "screencast" // block-out-from "screen-capture" + variable-refresh-rate true focus-ring { // off @@ -391,6 +392,26 @@ window-rule { } ``` +#### `variable-refresh-rate` + +Since: 0.1.9 + +If set to true, whenever this window displays on an output with on-demand VRR, it will enable VRR on that output. + +```kdl +// Configure some output with on-demand VRR. +output "HDMI-A-1" { + variable-refresh-rate on-demand=true +} + +// Enable on-demand VRR when mpv displays on the output. +window-rule { + match app-id="^mpv$" + + variable-refresh-rate true +} +``` + #### `draw-border-with-background` Override whether the border and the focus ring draw with a background. -- cgit