COSMIC output managment
此协议作为 wlr-output-management 的扩展。
它主要添加了显式输出镜像功能,同时上游正在研究如何最好地支持此功能。
它针对 wlr-output-management 版本 4 设计,但尽力保持前向兼容性。
此接口为 wlr-output-management 类型提供扩展点。
get_head(extended: new_id<zcosmic_output_head_v1>, head: object<zwlr_output_head_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| extended | new_id<zcosmic_output_head_v1> | |
| head | object<zwlr_output_head_v1> |
获取 zwlr_output_head_v1 的扩展对象。
一旦扩展输出被创建,事件将被分发,随后向匹配的 'zwlr_output_manager_v1' 传递一个伴随的 'done' 事件。
任何进一步的更新将产生新事件,如果 zcosmic_output_head_v1 的属性发生变化,就像原始的 'zwlr_output_head_v1' 一样。事件应被视为原子的,如 'zwlr_output_manager_v1::done' 所示。
尝试为每个 zwlr_output_head_v1 创建多个 zcosmic_output_head_v1 将引发 "already_extended" 错误。
get_configuration(extended: new_id<zcosmic_output_configuration_v1>, config: object<zwlr_output_configuration_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| extended | new_id<zcosmic_output_configuration_v1> | |
| config | object<zwlr_output_configuration_v1> |
获取 zwlr_output_configuration_v1 的扩展对象。
尝试为每个 zwlr_output_configuration_v1 创建多个 zcosmic_output_configuration_v1 将引发 "already_extended" 错误。
get_configuration_head(extended: new_id<zcosmic_output_configuration_head_v1>, config_head: object<zwlr_output_configuration_head_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| extended | new_id<zcosmic_output_configuration_head_v1> | |
| config_head | object<zwlr_output_configuration_head_v1> |
获取 zwlr_output_configuration_head_v1 的扩展对象。
尝试为每个 zwlr_output_configuration_head_v1 创建多个 zcosmic_output_configuration_head_v1 将引发 "already_extended" 错误。
set_xwayland_primary(head: object<zcosmic_output_head_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| head | object<zcosmic_output_head_v1>允许为空 | head to be advertised as primary |
此请求将一个 head 作为通过 randr 向 Xwayland 通告的主输出。
不必标记主 head,如果传递 'null',Xwayland 将不通告主输出。发送已禁用的 head 将被忽略以避免竞争。
zwlr_output_head_v1 的扩展。
添加额外的只读属性。
通过此接口发送的属性通过 wlr_output_manager.done 事件原子地应用。不保证属性的发送顺序。
scale_1000(scale_1000: int)
参数 | 类型 | 描述 |
|---|---|---|
| scale_1000 | int |
此事件描述 head 在全局合成器空间中的缩放比例,乘以 1000 以获得额外精度。
仅在输出启用时发送。
mirroring(name: string)
参数 | 类型 | 描述 |
|---|---|---|
| name | string允许为空 |
此事件描述 head 正在镜像另一个 head。在这种情况下,'name' 包含匹配的 'zwlr_output_head_v1' 的唯一名称。如果名称为 null,则没有 head 被镜像到此 head 上。
对于镜像的 head,'position' 事件无意义。
仅在输出启用时发送。
adaptive_sync_available(available: uint<zcosmic_output_head_v1.adaptive_sync_availability>)
此事件描述此 head 是否支持 adaptive_sync。
仅在输出启用时发送。
adaptive_sync_ext(state: uint<zcosmic_output_head_v1.adaptive_sync_state_ext>)
此事件描述此 head 的 adaptive_sync 状态。
仅在输出启用时发送。
xwayland_primary(state: uint)
参数 | 类型 | 描述 |
|---|---|---|
| state | uint | boolean if primary or not |
此事件描述此 head 是否作为通过 randr 向 Xwayland 通告的主输出。
最多一个输出被标记为主输出,但不保证任何输出被标记。 仅在输出启用时发送。
adaptive_sync_availability { unsupported, requires_modeset, supported }
参数 | 值 | 描述 |
|---|---|---|
| unsupported | 0 | 不支持 adaptive sync |
| requires_modeset | 1 | 自动 adaptive sync 不可用 |
| supported | 2 | 在所有状态下都支持 adaptive sync |
zwlr_output_configuration_v1 的扩展。
添加要通过原始 zwlr_output_configuration_v1 测试/应用的附加参数。
mirror_head(id: new_id<zwlr_output_configuration_head_v1>, head: object<zwlr_output_head_v1>, mirroring: object<zwlr_output_head_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<zwlr_output_configuration_head_v1> | a new object to configure the head |
| head | object<zwlr_output_head_v1> | the head to be enabled |
| mirroring | object<zwlr_output_head_v1> | the head to be mirrored |
启用一个 head 镜像另一个 head。
此请求创建一个 head 配置对象,可用于更改 head 的属性。
这是 'zwlr_output_configuration_v1::enable_head' 或 'zwlr_output_configuration_v1::disable_head' 的替代方案。使用相同的 'head' 参数调用任一方法将在原始 'zwlr_output_configuration_v1' 对象上引发 'already_configured_head' 错误。
客户端仍然需要按照原始协议中所述将所有属性设置到生成的 'zwlr_output_configuration_head' 上。但某些属性如 'set_position' 在镜像配置中可能会被忽略。
尝试将已禁用或正在镜像的 head 设为 'mirroring',或在将 head 用作 'mirroring' 参数后调用 'disable_head'/'mirror_head',将引发 'mirrored_head_busy' 协议错误。
release()
使用此请求,客户端可以告诉合成器它不再使用配置对象。对输出的任何更改仍将附加到原始 'zwlr_output_configuration_head_v1'(如果它未被销毁)。
finished()
此事件表示配置不再可用。
这通常在原始配置被 'cancelled'、'succeeded' 或 'failed' 时发生。
收到此事件后,客户端应销毁此对象。
配置对象变为惰性,除 'destroy' 外的任何请求都将被忽略。
error { already_finished, mirrored_head_busy }
参数 | 值 | 描述 |
|---|---|---|
| already_finished | 1 | 底层配置已被使用 |
| mirrored_head_busy | 2 | 镜像的 head 未启用 |
zwlr_output_configuration_head_v1 的扩展。
向原始 zwlr_output_configuration_head_v1 添加附加/替代参数。
一旦原始 'zwlr_output_configuration_head_v1' 被销毁,此对象将变为惰性,除 'release' 外的所有请求将被忽略。
set_scale_1000(scale_1000: int)
参数 | 类型 | 描述 |
|---|---|---|
| scale_1000 | int |
此请求设置 head 的缩放比例乘以 1000 以获得额外精度。
此请求旨在替代 'zwlr_output_configuration_head_v1::set_scale'。同时使用 'set_scale' 和 'set_scale_1000' 将在原始 'zwlr_output_configuration_head_v1' 上引发 'already_set' 错误。
与 'set_scale' 冲突的任何请求也将与 'set_scale_1000' 冲突。
release()
使用此请求,客户端可以告诉合成器它不再使用配置对象。已发出的请求仍将附加到原始 'zwlr_output_configuration_head_v1',直到它被销毁。
set_adaptive_sync_ext(state: uint<zcosmic_output_head_v1.adaptive_sync_state_ext>)
此请求请求新的 adaptive sync 状态。
此请求旨在替代 'zwlr_output_configuration_head_v1::set_adaptive_sync'。同时使用 'set_adaptive_sync' 和 'set_adaptive_sync_ext' 将在原始 'zwlr_output_configuration_head_v1' 上引发 'already_set' 错误。
与 'set_adaptive_sync' 冲突的任何请求也将与 'set_adaptive_sync_ext' 冲突。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| zcosmic_output_manager_v1 | x | 3 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
Copyright
Copyright © 2024 Victoria Brekenfeld
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.