1
0
Fork 0
forked from wry/wry

config: allow configuring client capabilities

This commit is contained in:
Julian Orth 2025-09-18 21:06:28 +02:00
parent 76a1a86091
commit e680a3dc09
21 changed files with 624 additions and 39 deletions

View file

@ -605,6 +605,40 @@
"clickfinger"
]
},
"ClientCapabilities": {
"description": "A mask of client capabilities.\n",
"anyOf": [
{
"type": "string",
"description": "A named mask.",
"enum": [
"none",
"all",
"data-control",
"virtual-keyboard",
"foreign-toplevel-list",
"idle-notifier",
"session-lock",
"layer-shell",
"screencopy",
"seat-manager",
"drm-lease",
"input-method",
"workspace-manager",
"foreign-toplevel-manager",
"head-manager"
]
},
{
"type": "array",
"description": "An array of masks that are OR'd.",
"items": {
"description": "",
"$ref": "#/$defs/ClientCapabilities"
}
}
]
},
"ClientMatch": {
"description": "Criteria for matching clients.\n\nIf no fields are set, all clients are matched. If multiple fields are set, all fields\nmust match the client.\n",
"type": "object",
@ -737,6 +771,14 @@
"latch": {
"description": "An action to execute when a client no longer matches the criteria.",
"$ref": "#/$defs/Action"
},
"capabilities": {
"description": "Sets the capabilities granted to clients matching this matcher.\n\nIf multiple matchers match a client, the capabilities are added.\n\nIf no matcher matches a client, it is granted the default capabilities depending\non whether it's sandboxed or not. If it is not sandboxed, it is granted the\ncapabilities `layer-shell` and `drm-lease`. Otherwise it is granted the\ncapability `drm-lease`.\n\nRegardless of any capabilities set through this function, the capabilities of the\nclient can never exceed its bounding capabilities.\n",
"$ref": "#/$defs/ClientCapabilities"
},
"sandbox-bounding-capabilities": {
"description": "Sets the upper capability bounds for clients in sandboxes created by this client.\n\nIf multiple matchers match a client, the capabilities are added.\n\nIf no matcher matches a client, the bounding capabilities for sandboxes depend on\nwhether the client is itself sandboxed. If it is sandboxed, the bounding\ncapabilities are the effective capabilities of the client. Otherwise the bounding\ncapabilities are all capabilities.\n\nRegardless of any capabilities set through this function, the capabilities set\nthrough this function can never exceed the client's bounding capabilities.\n",
"$ref": "#/$defs/ClientCapabilities"
}
},
"required": []

View file

@ -870,6 +870,90 @@ The string should have one of the following values:
<a name="types-ClientCapabilities"></a>
### `ClientCapabilities`
A mask of client capabilities.
Values of this type should have one of the following forms:
#### A string
A named mask.
The string should have one of the following values:
- `none`:
No capabilities.
- `all`:
The mask containing all capabilities.
- `data-control`:
Grants access to the `ext_data_control_manager_v1` and
`zwlr_data_control_manager_v1` globals.
- `virtual-keyboard`:
Grants access to the `zwp_virtual_keyboard_manager_v1` global.
- `foreign-toplevel-list`:
Grants access to the `ext_foreign_toplevel_list_v1` global.
- `idle-notifier`:
Grants access to the `ext_idle_notifier_v1` global.
- `session-lock`:
Grants access to the `ext_session_lock_manager_v1` global.
- `layer-shell`:
Grants access to the `zwlr_layer_shell_v1` global.
- `screencopy`:
Grants access to the `ext_image_copy_capture_manager_v1` and
`zwlr_screencopy_manager_v1` globals.
- `seat-manager`:
Grants access to the `ext_transient_seat_manager_v1` global.
- `drm-lease`:
Grants access to the `wp_drm_lease_device_v1` global.
- `input-method`:
Grants access to the `zwp_input_method_manager_v2` global.
- `workspace-manager`:
Grants access to the `ext_workspace_manager_v1` global.
- `foreign-toplevel-manager`:
Grants access to the `zwlr_foreign_toplevel_manager_v1` global.
- `head-manager`:
Grants access to the `jay_head_manager_v1` and `zwlr_output_manager_v1`
globals.
#### An array
An array of masks that are OR'd.
Each element of this array should be a [ClientCapabilities](#types-ClientCapabilities).
<a name="types-ClientMatch"></a>
### `ClientMatch`
@ -1157,6 +1241,38 @@ The table has the following fields:
The value of this field should be a [Action](#types-Action).
- `capabilities` (optional):
Sets the capabilities granted to clients matching this matcher.
If multiple matchers match a client, the capabilities are added.
If no matcher matches a client, it is granted the default capabilities depending
on whether it's sandboxed or not. If it is not sandboxed, it is granted the
capabilities `layer-shell` and `drm-lease`. Otherwise it is granted the
capability `drm-lease`.
Regardless of any capabilities set through this function, the capabilities of the
client can never exceed its bounding capabilities.
The value of this field should be a [ClientCapabilities](#types-ClientCapabilities).
- `sandbox-bounding-capabilities` (optional):
Sets the upper capability bounds for clients in sandboxes created by this client.
If multiple matchers match a client, the capabilities are added.
If no matcher matches a client, the bounding capabilities for sandboxes depend on
whether the client is itself sandboxed. If it is sandboxed, the bounding
capabilities are the effective capabilities of the client. Otherwise the bounding
capabilities are all capabilities.
Regardless of any capabilities set through this function, the capabilities set
through this function can never exceed the client's bounding capabilities.
The value of this field should be a [ClientCapabilities](#types-ClientCapabilities).
<a name="types-Color"></a>
### `Color`

View file

@ -3404,6 +3404,36 @@ ClientRule:
ref: Action
required: false
description: An action to execute when a client no longer matches the criteria.
capabilities:
ref: ClientCapabilities
required: false
description: |
Sets the capabilities granted to clients matching this matcher.
If multiple matchers match a client, the capabilities are added.
If no matcher matches a client, it is granted the default capabilities depending
on whether it's sandboxed or not. If it is not sandboxed, it is granted the
capabilities `layer-shell` and `drm-lease`. Otherwise it is granted the
capability `drm-lease`.
Regardless of any capabilities set through this function, the capabilities of the
client can never exceed its bounding capabilities.
sandbox-bounding-capabilities:
ref: ClientCapabilities
required: false
description: |
Sets the upper capability bounds for clients in sandboxes created by this client.
If multiple matchers match a client, the capabilities are added.
If no matcher matches a client, the bounding capabilities for sandboxes depend on
whether the client is itself sandboxed. If it is sandboxed, the bounding
capabilities are the effective capabilities of the client. Otherwise the bounding
capabilities are all capabilities.
Regardless of any capabilities set through this function, the capabilities set
through this function can never exceed the client's bounding capabilities.
ClientMatch:
@ -4061,3 +4091,63 @@ BlendSpace:
description: The sRGB blend space. This is the classic desktop blend space.
- value: linear
description: Linear color space. This is the physically correct blend space.
ClientCapabilities:
description: |
A mask of client capabilities.
kind: variable
variants:
- kind: string
description: A named mask.
values:
- value: none
description: No capabilities.
- value: all
description: The mask containing all capabilities.
- value: data-control
description: |
Grants access to the `ext_data_control_manager_v1` and
`zwlr_data_control_manager_v1` globals.
- value: virtual-keyboard
description: |
Grants access to the `zwp_virtual_keyboard_manager_v1` global.
- value: foreign-toplevel-list
description: |
Grants access to the `ext_foreign_toplevel_list_v1` global.
- value: idle-notifier
description: |
Grants access to the `ext_idle_notifier_v1` global.
- value: session-lock
description: |
Grants access to the `ext_session_lock_manager_v1` global.
- value: layer-shell
description: |
Grants access to the `zwlr_layer_shell_v1` global.
- value: screencopy
description: |
Grants access to the `ext_image_copy_capture_manager_v1` and
`zwlr_screencopy_manager_v1` globals.
- value: seat-manager
description: |
Grants access to the `ext_transient_seat_manager_v1` global.
- value: drm-lease
description: |
Grants access to the `wp_drm_lease_device_v1` global.
- value: input-method
description: |
Grants access to the `zwp_input_method_manager_v2` global.
- value: workspace-manager
description: |
Grants access to the `ext_workspace_manager_v1` global.
- value: foreign-toplevel-manager
description: |
Grants access to the `zwlr_foreign_toplevel_manager_v1` global.
- value: head-manager
description: |
Grants access to the `jay_head_manager_v1` and `zwlr_output_manager_v1`
globals.
- kind: array
description: An array of masks that are OR'd.
items:
ref: ClientCapabilities