diff options
| author | Michael Yang <admin@my4ng.dev> | 2024-08-22 18:58:07 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-22 11:58:07 +0300 |
| commit | f1894f6f9a7470b8b1493cf96b28a48e8a704636 (patch) | |
| tree | d70a3ab350d39dea1b8240e2a92b281b01be5d12 /niri-ipc | |
| parent | dfc2d452c55d59d6d9014c98a9da3a082c4f7379 (diff) | |
| download | niri-f1894f6f9a7470b8b1493cf96b28a48e8a704636.tar.gz niri-f1894f6f9a7470b8b1493cf96b28a48e8a704636.tar.bz2 niri-f1894f6f9a7470b8b1493cf96b28a48e8a704636.zip | |
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 <yalterz@gmail.com>
Diffstat (limited to 'niri-ipc')
| -rw-r--r-- | niri-ipc/src/lib.rs | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs index 7317436c..713db8af 100644 --- a/niri-ipc/src/lib.rs +++ b/niri-ipc/src/lib.rs @@ -352,18 +352,11 @@ pub enum OutputAction { #[cfg_attr(feature = "clap", command(subcommand))] position: PositionToSet, }, - /// Toggle variable refresh rate. + /// Set the variable refresh rate mode. Vrr { - /// Whether to enable variable refresh rate. - #[cfg_attr( - feature = "clap", - arg( - value_name = "ON|OFF", - action = clap::ArgAction::Set, - value_parser = clap::builder::BoolishValueParser::new(), - ), - )] - enable: bool, + /// Variable refresh rate mode to set. + #[cfg_attr(feature = "clap", command(flatten))] + vrr: VrrToSet, }, } @@ -425,6 +418,27 @@ pub struct ConfiguredPosition { pub y: i32, } +/// Output VRR to set. +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq)] +#[cfg_attr(feature = "clap", derive(clap::Args))] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] +pub struct VrrToSet { + /// Whether to enable variable refresh rate. + #[cfg_attr( + feature = "clap", + arg( + value_name = "ON|OFF", + action = clap::ArgAction::Set, + value_parser = clap::builder::BoolishValueParser::new(), + hide_possible_values = true, + ), + )] + pub vrr: bool, + /// Only enable when the output shows a window matching the variable-refresh-rate window rule. + #[cfg_attr(feature = "clap", arg(long))] + pub on_demand: bool, +} + /// Connected output. #[derive(Debug, Serialize, Deserialize, Clone)] #[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] |
