创建桌面小部件和辅助工具

传统用户界面可以依赖此接口来定义典型桌面的基础。目前可以设置背景、面板和锁定表面。

set_background(output: object<wl_output>, surface: object<wl_surface>)
参数
类型
描述
outputobject<wl_output>
surfaceobject<wl_surface>
set_panel(output: object<wl_output>, surface: object<wl_surface>)
参数
类型
描述
outputobject<wl_output>
surfaceobject<wl_surface>
set_lock_surface(surface: object<wl_surface>)
参数
类型
描述
surfaceobject<wl_surface>
set_grab_surface(surface: object<wl_surface>)
参数
类型
描述
surfaceobject<wl_surface>
设置抓取表面

此请求设置的表面将在抓取期间在位置 0, 0 处接收虚假的 pointer.enter 事件,并应设置适当的光标图像,如紧接在 enter 事件之前发送的 grab_cursor 事件所述。

desktop_ready()
桌面已准备好显示

告知服务器,已绘制足够的桌面元素使桌面看起来已准备好使用。在启动期间,服务器可以使用黑屏等待此请求,然后再开始淡入桌面。如果桌面的客户端部分需要很长时间来初始化,我们避免显示临时的垃圾内容。

set_panel_position(position: uint)
参数
类型
描述
positionuint
设置面板位置

告知 shell 面板位于屏幕的哪一侧。这样新窗口就不会与面板重叠,最大化窗口也能正确最大化。

configure(edges: uint, surface: object<wl_surface>, width: int, height: int)
参数
类型
描述
edgesuint
surfaceobject<wl_surface>
widthint
heightint
prepare_lock_surface()
告知客户端创建并设置锁定表面

告知客户端我们希望它创建并设置锁定表面,即请求用户解锁屏幕的 GUI。锁定表面通过 'set_lock_surface' 公布。无论客户端是否实际实现锁定,它都必须发送 'unlock' 请求以恢复正常桌面。

grab_cursor(cursor: uint)
参数
类型
描述
cursoruint
告知客户端在抓取期间显示什么光标

此事件将在抓取表面上的虚假 enter 事件之前立即发送。

error { invalid_argument } 
参数
描述
invalid_argument0
请求中提供了无效参数

实现屏保的接口

一次只能有一个客户端绑定此接口。

set_surface(surface: object<wl_surface>, output: object<wl_output>)
参数
类型
描述
surfaceobject<wl_surface>
outputobject<wl_output>
将表面类型设置为屏保

屏保表面通常是隐藏的,只有在空闲超时后才可见。


合成器支持

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
weston_desktop_shell
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
1

Footer

© 2026 Wayland Explorer

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

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