提交时序 (commit timing)

当合成器(compositor)锁定新的内容更新时,它会检查可用内容更新的任意数量要求(例如所有缓冲区的同步栅栏均已触发),以认为更新已就绪。

此协议提供了一种为 surface(表面)内容添加时间约束的方法。此约束向合成器指示内容更新应尽可能接近但不早于指定的时间进行呈现(presentation)。

此协议不改变 Wayland 内容更新按接收顺序应用(apply)的属性,即使某些内容更新包含时间戳而其他不包含。

要提供时间戳,必须使用此全局工厂接口(global factory interface)为 surface 获取一个 `wp_commit_timing_v1` 对象,然后可将其用于为提交(commits)提供时间戳信息。

警告!此文件中描述的协议目前处于测试阶段。向后兼容的更改可能会与相应的接口版本提升一起添加。向后不兼容的更改只能通过创建此扩展的新主版本来完成。

destroy()
解除绑定提交时序接口

通知服务器客户端将不再使用此协议对象。由此对象创建的现有对象不受影响。

get_timer(id: new_id<wp_commit_timer_v1>, surface: object<wl_surface>)
参数
类型
描述
idnew_id<wp_commit_timer_v1>
surfaceobject<wl_surface>
请求 surface 的提交计时器接口

为 surface 建立时序控制器(timing controller)。

一个 surface 只能创建一个提交计时器(commit timer),否则将生成 `commit_timer_exists` 协议错误。

参数
描述
commit_timer_exists0
surface 已存在提交计时器

surface 提交计时器

用于为 surface 上的内容更新设置时间约束的对象。

set_timestamp(tv_sec_hi: uint, tv_sec_lo: uint, tv_nsec: uint)
参数
类型
描述
tv_sec_hiuint
high 32 bits of the seconds part of target time
tv_sec_louint
low 32 bits of the seconds part of target time
tv_nsecuint
nanoseconds part of target time
设置具有指定时间的计时器

为 surface 内容更新提供时序约束。

可以在 `wl_surface.commit` 之前发出 `set_timestamp` 请求,以告知合成器该内容旨在尽可能接近但不早于指定时间进行呈现(presentation)。时间处于合成器 presentation 时钟的域内。

对于无效的 `tv_nsec`,将生成 `invalid_timestamp` 错误。

如果在没有新内容更新的情况下提供了时间戳,将生成 `no_update` 错误。

destroy
类型: destructor
destroy()
销毁计时器对象

销毁计时器对象。由于此对象设置的计时器状态是双缓冲的(double-buffered),因此销毁计时器对象可以在提交时间戳之前移除由该计时器对象设置的挂起(pending)且未提交(uncommitted)的时间戳。

参数
描述
invalid_timestamp0
无效的时间戳
timestamp_exists1
时间戳已存在
surface_destroyed2
关联的 surface 已不存在

合成器支持

Cage
Cage
0.2.0
COSMIC
COSMIC
1.0.0~beta.8
GameScope
GameScope
3.15.14
Hyprland
Hyprland
0.52.1
Jay
1.12.0
KWin
KWin
6.6
Labwc
Labwc
0.9.2
Louvre
Louvre
2.14.1
Mir
Mir
2.26
Muffin
Muffin
6.6.0
Mutter
Mutter
49.2
niri
niri
25.11
phoc
phoc
0.52
river
river
0.3.13
Sway
Sway
1.11
Treeland
Treeland
0.8.0
Wayfire
Wayfire
0.9.0
Weston
Weston
14.0.2
wp_commit_timing_manager_v1
x
x
x
1
1
x
x
x
x
x
1
x
x
x
x
x
x
x

Copyright © 2023 Valve Corporation

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.

Footer

© 2026 Wayland Explorer

本网站与 Wayland 官方项目无任何关联。网站所有内容均根据 Wayland 协议 XML 文件自动生成。

本网站使用的 Visual Studio Code - Codicons 遵循 CC BY 4.0 许可。