surface 内容类型管理器

此接口允许客户端描述 surface 将显示的内容种类,以允许 compositor 为其优化行为。

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

destroy()
销毁内容类型管理器对象

销毁内容类型管理器。这不会销毁使用该管理器创建的对象。

get_surface_content_type(id: new_id<wp_content_type_v1>, surface: object<wl_surface>)
参数
类型
描述
idnew_id<wp_content_type_v1>
surfaceobject<wl_surface>
创建新的内容类型对象

创建与给定 surface 关联的新内容类型对象。

从已附加内容类型对象的 wl_surface 创建 wp_content_type_v1 会导致客户端错误:already_constructed。

参数
描述
already_constructed0
wl_surface 已经拥有内容类型对象

surface 的内容类型对象

内容类型对象允许 compositor 针对 surface 上显示的内容类型进行优化。例如,compositor 可以使用它来设置相关的 drm 属性(如“内容类型”)。

客户端可以随时请求切换到另一种内容类型。 当关联的 surface 被销毁时,此对象将变得无效,客户端应将其销毁。

destroy
类型: destructor
destroy()
销毁内容类型对象

切换回未指定此 surface 的内容类型。这等效于将内容类型设置为 none,包括双缓冲语义。有关详细信息,请参阅 set_content_type。

set_content_type(content_type: uint<wp_content_type_v1.type>)
参数
类型
描述
content_typeuint<wp_content_type_v1.type>
the content type
指定内容类型

设置 surface 内容类型。这会通知 compositor 客户端认为它正在显示匹配此内容类型的 buffer。

这纯粹是为 compositor 提供的一个提示,可用于调整其行为或硬件设置,以最适合所呈现的内容。

内容类型是双缓冲状态,有关详细信息,请参阅 wl_surface.commit。

type { none, photo, video, game } 
参数
描述
none0
没有适用的内容类型

内容类型 none 意味着应用程序没有关于内容类型的数据,或者内容不适合其他任何类别。

photo1
photo 内容类型

内容类型 photo 描述了源自数码静态图片的内容,可以以最少的处理来呈现。

video2
video 内容类型

内容类型 video 描述了视频或动画,可以以更准确的时序呈现,以避免卡顿。在需要缩放时,可能会使用更适合视频的缩放方法。

game3
game 内容类型

内容类型 game 描述了正在运行的游戏。其内容可以以较低的延迟呈现。

可能的内容类型

这些值描述了 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_content_type_manager_v1
x
x
x
1
1
1
x
1
x
x
x
x
x
x
1
x
x
x

Copyright © 2021 Emmanuel Gil Peyrot Copyright © 2022 Xaver Hugl

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 许可。