1
0
Fork 0
forked from wry/wry

metal: implement VRR

This commit is contained in:
Julian Orth 2024-07-17 16:30:52 +02:00
parent cd09e57568
commit 2d7c13b0b4
35 changed files with 1320 additions and 91 deletions

View file

@ -577,6 +577,10 @@
"window-management-key": {
"type": "string",
"description": "Configures a key that will enable window management mode while pressed.\n\nIn window management mode, floating windows can be moved by pressing the left\nmouse button and all windows can be resize by pressing the right mouse button.\n\n- Example:\n\n ```toml\n window-management-key = \"Alt_L\"\n ```\n"
},
"vrr": {
"description": "Configures the default VRR settings.\n\nThis can be overwritten for individual outputs.\n\nBy default, the VRR mode is `never` and the cursor refresh rate is unbounded.\n\n- Example:\n \n ```toml\n vrr = { mode = \"always\", cursor-hz = 90 }\n ```\n",
"$ref": "#/$defs/Vrr"
}
},
"required": []
@ -1023,6 +1027,10 @@
"mode": {
"description": "The mode of the output.\n\nIf the refresh rate is not specified, the first mode with the specified width and\nheight is used.\n",
"$ref": "#/$defs/Mode"
},
"vrr": {
"description": "Configures the VRR settings of this output.\n\nBy default, the VRR mode is `never` and the cursor refresh rate is unbounded.\n\n- Example:\n\n ```toml\n [[outputs]]\n match.serial-number = \"33K03894SL0\"\n vrr = { mode = \"always\", cursor-hz = 90 }\n ```\n",
"$ref": "#/$defs/Vrr"
}
},
"required": [
@ -1234,6 +1242,45 @@
"flip-rotate-180",
"flip-rotate-270"
]
},
"Vrr": {
"description": "Describes VRR settings.\n\n- Example:\n\n ```toml\n vrr = { mode = \"always\", cursor-hz = 90 }\n ```\n",
"type": "object",
"properties": {
"mode": {
"description": "The VRR mode.",
"$ref": "#/$defs/VrrMode"
},
"cursor-hz": {
"description": "The VRR cursor refresh rate.\n\nLimits the rate at which cursors are updated on screen when VRR is active.\n",
"$ref": "#/$defs/VrrHz"
}
},
"required": []
},
"VrrHz": {
"description": "A VRR refresh rate limiter.\n\n- Example 1:\n\n ```toml\n vrr = { cursor-hz = 90 }\n ```\n\n- Example 2:\n\n ```toml\n vrr = { cursor-hz = \"none\" }\n ```\n",
"anyOf": [
{
"type": "string",
"description": "The string `none` can be used to disable the limiter."
},
{
"type": "number",
"description": "The refresh rate in HZ."
}
]
},
"VrrMode": {
"type": "string",
"description": "The VRR mode of an output.\n\n- Example:\n\n ```toml\n vrr = { mode = \"always\", cursor-hz = 90 }\n ```\n",
"enum": [
"always",
"never",
"variant1",
"variant2",
"variant3"
]
}
}
}

View file

@ -1110,6 +1110,22 @@ The table has the following fields:
The value of this field should be a string.
- `vrr` (optional):
Configures the default VRR settings.
This can be overwritten for individual outputs.
By default, the VRR mode is `never` and the cursor refresh rate is unbounded.
- Example:
```toml
vrr = { mode = "always", cursor-hz = 90 }
```
The value of this field should be a [Vrr](#types-Vrr).
<a name="types-Connector"></a>
### `Connector`
@ -2166,6 +2182,22 @@ The table has the following fields:
The value of this field should be a [Mode](#types-Mode).
- `vrr` (optional):
Configures the VRR settings of this output.
By default, the VRR mode is `never` and the cursor refresh rate is unbounded.
- Example:
```toml
[[outputs]]
match.serial-number = "33K03894SL0"
vrr = { mode = "always", cursor-hz = 90 }
```
The value of this field should be a [Vrr](#types-Vrr).
<a name="types-OutputMatch"></a>
### `OutputMatch`
@ -2672,3 +2704,98 @@ The string should have one of the following values:
<a name="types-Vrr"></a>
### `Vrr`
Describes VRR settings.
- Example:
```toml
vrr = { mode = "always", cursor-hz = 90 }
```
Values of this type should be tables.
The table has the following fields:
- `mode` (optional):
The VRR mode.
The value of this field should be a [VrrMode](#types-VrrMode).
- `cursor-hz` (optional):
The VRR cursor refresh rate.
Limits the rate at which cursors are updated on screen when VRR is active.
The value of this field should be a [VrrHz](#types-VrrHz).
<a name="types-VrrHz"></a>
### `VrrHz`
A VRR refresh rate limiter.
- Example 1:
```toml
vrr = { cursor-hz = 90 }
```
- Example 2:
```toml
vrr = { cursor-hz = "none" }
```
Values of this type should have one of the following forms:
#### A string
The string `none` can be used to disable the limiter.
#### A number
The refresh rate in HZ.
<a name="types-VrrMode"></a>
### `VrrMode`
The VRR mode of an output.
- Example:
```toml
vrr = { mode = "always", cursor-hz = 90 }
```
Values of this type should be strings.
The string should have one of the following values:
- `always`:
VRR is never enabled.
- `never`:
VRR is always enabled.
- `variant1`:
VRR is enabled when one or more applications are displayed fullscreen.
- `variant2`:
VRR is enabled when a single application is displayed fullscreen.
- `variant3`:
VRR is enabled when a single game or video is displayed fullscreen.

View file

@ -1558,6 +1558,21 @@ Output:
If the refresh rate is not specified, the first mode with the specified width and
height is used.
vrr:
ref: Vrr
required: false
description: |
Configures the VRR settings of this output.
By default, the VRR mode is `never` and the cursor refresh rate is unbounded.
- Example:
```toml
[[outputs]]
match.serial-number = "33K03894SL0"
vrr = { mode = "always", cursor-hz = 90 }
```
Transform:
@ -2150,6 +2165,21 @@ Config:
```toml
window-management-key = "Alt_L"
```
vrr:
ref: Vrr
required: false
description: |
Configures the default VRR settings.
This can be overwritten for individual outputs.
By default, the VRR mode is `never` and the cursor refresh rate is unbounded.
- Example:
```toml
vrr = { mode = "always", cursor-hz = 90 }
```
Idle:
@ -2267,3 +2297,73 @@ ComplexShortcut:
Audio will be un-muted once `x` key is released, regardless of any other keys
that are pressed at the time.
Vrr:
kind: table
description: |
Describes VRR settings.
- Example:
```toml
vrr = { mode = "always", cursor-hz = 90 }
```
fields:
mode:
ref: VrrMode
required: false
description: The VRR mode.
cursor-hz:
ref: VrrHz
required: false
description: |
The VRR cursor refresh rate.
Limits the rate at which cursors are updated on screen when VRR is active.
VrrMode:
description: |
The VRR mode of an output.
- Example:
```toml
vrr = { mode = "always", cursor-hz = 90 }
```
kind: string
values:
- value: always
description: VRR is never enabled.
- value: never
description: VRR is always enabled.
- value: variant1
description: VRR is enabled when one or more applications are displayed fullscreen.
- value: variant2
description: VRR is enabled when a single application is displayed fullscreen.
- value: variant3
description: VRR is enabled when a single game or video is displayed fullscreen.
VrrHz:
description: |
A VRR refresh rate limiter.
- Example 1:
```toml
vrr = { cursor-hz = 90 }
```
- Example 2:
```toml
vrr = { cursor-hz = "none" }
```
kind: variable
variants:
- kind: string
description: The string `none` can be used to disable the limiter.
- kind: number
description: The refresh rate in HZ.