Chromium aura shell

zaura_shell

版本 65
aura_shell

暴露 aura shell 能力的全局接口,用于为 wl_surface 对象实例化接口扩展。该扩展接口随后允许客户端使用 aura shell 特定的功能。

get_aura_surface(id: new_id<zaura_surface>, surface: object<wl_surface>)
参数
类型
描述
idnew_id<zaura_surface>
the new aura surface interface id
surfaceobject<wl_surface>
the surface
为 aura shell 扩展 surface 接口

为给定的 wl_surface 实例化接口扩展,以提供 aura shell 功能。如果给定的 wl_surface 未关联 shell surface,则会引发 shell_surface_missing 协议错误。

get_aura_output(id: new_id<zaura_output>, output: object<wl_output>)
参数
类型
描述
idnew_id<zaura_output>
the new aura output interface id
outputobject<wl_output>
the output
为 aura shell 扩展 output 接口

为给定的 wl_output 实例化接口扩展,以提供 aura shell 功能。

surface_submission_in_pixel_coordinates()
surface 将以像素坐标提交

[已弃用] 通知服务器在提交 surface 时,此客户端不会使用 wl_surface_set_buffer_scale 来报告缩放比例,也不会通过 vp_viewporter 应用缩放。相反,服务器应应用适当的缩放变换以使提交的 buffer 正确合成。

get_aura_toplevel_for_xdg_toplevel(id: new_id<zaura_toplevel>, toplevel: object<xdg_toplevel>)
参数
类型
描述
idnew_id<zaura_toplevel>
the new aura toplevel interface id
toplevelobject<xdg_toplevel>
获取 aura toplevel

为给定的 xdg toplevel 接口检索 aura toplevel 接口

get_aura_popup_for_xdg_popup(id: new_id<zaura_popup>, popup: object<xdg_popup>)
参数
类型
描述
idnew_id<zaura_popup>
the aura popup interface id
popupobject<xdg_popup>
获取 aura popup

为给定的 xdg popup 接口检索 aura popup 接口

release
类型: destructor起始版本 38
release()
释放 zaura_shell 对象

客户端使用此请求可以告诉服务器它将不再使用 zaura_shell 对象。这不会影响任何其他对象。

此处命名为 "release" 是因为 "destroy" 是用于释放 wl_proxy 对象的特殊命名函数。将其命名为 "destroy" 会在低版本主机上运行时导致编组错误。如果我们迁移到 aura-shell v2,此处所有的 "release" 请求应重命名为 "destroy"。

layout_mode(layout_mode: uint)
参数
类型
描述
layout_modeuint
layout_mode enum
发送 layout_mode

发送服务器使用的 layout_mode。

bug_fix
起始版本 14
bug_fix(id: uint)
参数
类型
描述
iduint
ID of a single bug fix
发送 bug 修复 ID

发送在 exo 服务器上修复的 bug 的 monorail ID,客户端可用于控制功能。

desks_changed(desk_names: array)
参数
类型
描述
desk_namesarray
an array of existing desks' names
发送桌面名称

当全局桌面状态发生变化时发出通知。此事件在桌面名称更改、桌面添加/删除或桌面重新排序时发出。"desk_names" 参数包含以 null 结尾的字符串集合作为桌面名称。

desk_activation_changed(active_desk_index: int)
参数
类型
描述
active_desk_indexint
index of the active desk
发送活动桌面的索引

当活动桌面发生变化时发出通知。

activated
起始版本 24
activated(gained_active: object<wl_surface>, lost_active: object<wl_surface>)
参数
类型
描述
gained_activeobject<wl_surface>允许为空
lost_activeobject<wl_surface>允许为空
活动 surface 已更改

通知客户端活动 surface 已更改。

set_overview_mode()
进入概览模式

通知客户端服务器已进入概览模式。概览模式显示与当前桌面关联的所有应用窗口。

unset_overview_mode()
退出概览模式

通知客户端服务器已退出概览模式。

compositor_version(version_label: string)
参数
类型
描述
version_labelstring
version string label
发送服务器版本

发送 Exo compositor 版本信息。

all_bug_fixes_sent()
所有 bug 修复 ID 发送完毕

通知客户端已在 exo 服务器上修复的所有 bug ID 已发送完毕。Bug 修复 ID 通过 `bug_fix` 事件逐个发送,而非数组。此事件用于确认所有 ID 已发送完毕。

window_corners_radii(upper_left_radius: uint, upper_right_radius: uint, lower_right_radius: uint, lower_left_radius: uint)
发送窗口每个圆角的半径

以 dips 为单位向客户端发送窗口每个圆角的半径。

参数
描述
aura_surface_exists0
该 surface 已关联 aura surface 对象
aura_output_exists1
该 output 已关联 aura output 对象
layout_mode { windowed, tablet } 
参数
描述
windowed1
多窗口
tablet2
平板限制模式
布局模式

指定服务器的窗口布局模式。


zaura_surface

版本 51
aura shell 的 wl_surface 接口

对 wl_surface 对象的附加接口,允许客户端访问 aura shell 的 surface 特定功能。

set_frame(type: uint)
参数
类型
描述
typeuint
the new frame type
为 surface 请求帧

[已弃用] 建议 surface 使用特定帧。自 M105 起弃用。请参阅 zaura_toplevel 和 zaura_popup 上的 set_decoration 方法。

set_parent(parent: object<zaura_surface>, x: int, y: int)
参数
类型
描述
parentobject<zaura_surface>允许为空
xint
yint
设置此 surface 的父级

设置此 surface 的 "父级"。"x" 和 "y" 参数指定 surface 相对于父级的初始位置。

set_frame_colors(active_color: uint, inactive_color: uint)
参数
类型
描述
active_coloruint
32 bit ARGB color value, not premultiplied
inactive_coloruint
32 bit ARGB color value, not premultiplied
设置此 surface 的帧颜色

设置帧颜色。必须在初始 commit 之前设置,否则后续请求可能不会被执行。

set_startup_id(startup_id: string)
参数
类型
描述
startup_idstring允许为空
设置此 surface 的启动 ID

设置启动 ID。

set_application_id(application_id: string)
参数
类型
描述
application_idstring允许为空
设置此 surface 的应用程序 ID

设置应用程序 ID。

set_client_surface_id(client_surface_id: int)
参数
类型
描述
client_surface_idint
设置此 surface 的客户端 surface ID

已弃用。请使用 set_client_surface_str_id 代替。 设置由客户端分配的 surface 标识符。

set_occlusion_tracking()
设置遮挡跟踪区域

在此 surface 上设置遮挡跟踪。当此 surface 的遮挡量发生变化时,客户端将收到新的遮挡比例更新。

unset_occlusion_tracking()
取消遮挡跟踪区域

取消此 surface 的遮挡跟踪。

activate()
指示此窗口希望成为活动窗口

[已弃用] 使此窗口成为活动窗口。这通常意味着将此 surface 重新堆叠到前台。如果 compositor 认为客户端行为不当,可以忽略此请求。通常此请求仅在响应某些用户驱动事件时才会被执行,例如执行应用程序或在已存在的窗口中打开文件。

draw_attention()
指示此窗口需要用户的部分注意力

在不改变用户焦点的情况下吸引对此 surface 的注意。这通常意味着动画化窗口装饰或任务栏图标。如果 compositor 认为合适,仍可忽略此请求,但与 draw_focus 不同的是,这些请求预计来自后台任务,更可能被执行。

set_fullscreen_mode(mode: uint<zaura_surface.fullscreen_mode>)
参数
类型
描述
modeuint<zaura_surface.fullscreen_mode>
设置 surface 在全屏模式下的行为

[已弃用] 使用 toplevel 接口中的 set_fullscreen_mode。 建议窗口系统在此 surface 进入全屏时的行为方式。不会使 surface 进入全屏。

通常默认模式为 "沉浸式"。

set_client_surface_str_id(client_surface_id: string)
参数
类型
描述
client_surface_idstring
设置此 surface 的客户端 surface ID

设置由客户端分配的 surface 标识符。

set_server_start_resize()
为 surface 请求服务器端阴影

建议 surface 使用客户端装饰,但由服务器决定何时何地开始调整大小。服务器还可以应用视觉效果来指示调整大小操作正在进行中。

客户端有意吸附 surface

[已弃用] 使用 zaura_toplevel 上的 intent_to_snap。 通知(或告知)服务器客户端有吸附窗口的意图。要告知不再愿意吸附,请发送 'none'。

set_snap_left()
将 surface 吸附到左侧

[已弃用] 使用 zaura_toplevel 上的 set_snap_primary。 请求将 surface 吸附到左侧。

set_snap_right()
将 surface 吸附到右侧

[已弃用] 使用 zaura_toplevel 上的 set_snap_secondary。 请求将 surface 吸附到右侧。

unset_snap()
取消 surface 的吸附状态

[已弃用] 使用 zaura_toplevel 上的 unset_snap。 请求重置 surface 的吸附状态。

set_window_session_id(id: int)
参数
类型
描述
idint
window session id
设置 surface 窗口会话 ID

为 surface 设置窗口会话 ID。

set_can_go_back()
设置返回手势时最小化行为

设置 surface 可以根据其导航列表返回。这允许服务器通过在系统范围的返回手势时最小化窗口来做出反应。

unset_can_go_back()
取消返回手势时最小化行为

取消设置 surface 可以根据其导航列表返回。参见上文。

set_pip
起始版本 20
set_pip()
为 surface 设置画中画

请求将 surface 设置为画中画(PIP)模式。

unset_pip()
取消 surface 的画中画

请求取消 surface 的画中画(PIP)模式。

set_aspect_ratio(width: int, height: int)
参数
类型
描述
widthint
heightint
为 surface 设置宽高比

设置 surface 的宽高比。

move_to_desk(index: int)
参数
类型
描述
indexint
移动到桌面

如果 |index| 等于 -1,请求服务器切换客户端是否在所有工作区可见。 如果 |index| 不是 -1,请求服务器将客户端移动到 |index| 处的桌面。

set_initial_workspace(initial_workspace: string)
参数
类型
描述
initial_workspacestring
intial workspace for restoring or '-1' for visible on all workspaces
恢复时的初始工作区

如果 |initial_workspace| 等于 '-1',窗口将被恢复并在所有工作区可见;否则,设置初始工作区以将窗口恢复到相应的工作区。这不是双缓冲的,必须在附加 buffer 之前设置。

set_pin
起始版本 25
set_pin(trusted: int)
参数
类型
描述
trustedint
0 for non trusted
固定窗口(受信任或不受信任)

请求固定窗口,这意味着系统不允许用户离开该窗口,直到满足退出条件。

这是一个请求将窗口固定,使用户无法访问任何其他窗口/应用程序。有两种模式: A. trusted 为 0 - 限制较少,允许用户通过预定义的身份验证方式退出窗口。 B. trusted 不为 0,此时受信任的应用程序正在锁定系统并需要解锁。这用于例如学校考试。

unset_pin()
取消固定窗口

请求允许用户离开先前固定的窗口。

这是一个请求取消固定先前固定的窗口。无论窗口是以受信任状态锁定还是不受信任状态锁定,都无关紧要。

release
类型: destructor起始版本 38
release()
销毁 zaura_surface

销毁 zaura_surface 对象。当角色从 wl_surface 取消映射时,客户端应销毁此对象。

有关析构函数命名,请参阅 zaura_shell.release。

show_tooltip(text: string, x: int, y: int, tooltip_trigger: uint, show_delay: uint, hide_delay: uint)
参数
类型
描述
textstring
xint
yint
tooltip_triggeruint
tooltip_trigger enum
show_delayuint
delay to show tooltip in millisecond
hide_delayuint
delay to hide tooltip in millisecond
显示工具提示窗口

在服务器端显示工具提示。 `x` 和 `y` 指定工具提示在 surface 局部坐标中的位置。 `hide_delay` 和 `show_delay` 指定显示/隐藏工具提示前的等待时间,单位为毫秒。

hide_tooltip()
隐藏工具提示窗口

隐藏由同一客户端在服务器端创建的工具提示。即使没有工具提示窗口可隐藏,也可以调用此方法。

set_accessibility_id(id: int)
参数
类型
描述
idint
Accessibility ID. Negative number removes existing accessibility ID from the surface.
为 surface 设置无障碍 ID

为 surface 设置无障碍窗口 ID。负数将从 surface 中移除现有的无障碍 ID。

occlusion_changed(occlusion_fraction: fixed, occlusion_reason: uint)
参数
类型
描述
occlusion_fractionfixed
occlusion_reasonuint
遮挡变化通知

当此 surface 的遮挡量发生变化时发出通知。遮挡更新以 0 到 1 的定点数发送,表示遮挡比例。

lock_frame_normal()
通知客户端服务器有意将窗口锁定在正常或还原状态

通知客户端将窗口锁定在正常或还原状态。当窗口被锁定时,窗口框架应看起来处于还原状态,但实际上并非如此。锁定发生在拖动最大化窗口时。

unlock_frame_normal()
通知客户端服务器有意解锁窗口的正常或还原状态

通知客户端解锁窗口(如果先前已锁定)。解锁发生在拖动最大化窗口时。

occlusion_state_changed(mode: uint<zaura_surface.occlusion_state>)
参数
类型
描述
modeuint<zaura_surface.occlusion_state>
通知客户端遮挡状态已更改

通知客户端窗口的遮挡状态已更改。客户端只有在先前通过 set_occlusion_tracking 为特定 surface 请求遮挡跟踪时才会收到这些消息。

desk_changed(state: int)
参数
类型
描述
stateint
index of desk or -1 for a window assigned to all desks
窗口桌面状态已更改

当窗口的桌面状态发生变化时发出通知。当窗口被移动到另一个桌面或其分配到所有桌面的状态发生变化时,会发出此事件。

start_throttle()
开始在 surface 上节流

通知客户端开始在 surface 上进行节流。

end_throttle()
结束在 surface 上的节流

通知客户端结束在 surface 上的节流。

tooltip_shown(text: string, x: int, y: int, width: int, height: int)
参数
类型
描述
textstring
xint
yint
widthint
heightint
工具提示已在服务器端显示

通知客户端工具提示已显示并带有状态。 `x` 和 `y` 指定工具提示在 surface 局部坐标中的位置。

tooltip_hidden()
工具提示已在服务器端隐藏

通知客户端工具提示已隐藏。

frame_type { none, normal, shadow } 
参数
描述
none0
无帧
normal1
带阴影的标题栏
shadow2
仅阴影
不同的帧类型

可用于装饰 surface 的帧类型。

occlusion_change_reason { user_action } 
参数
描述
user_action1
由用户操作引起的遮挡变化
遮挡变化原因

描述遮挡变化原因的枚举。由用户操作引起的遮挡变化可能包括用户移动窗口、改变遮挡、或打开/关闭窗口改变遮挡等情况。

fullscreen_mode { immersive, plain } 
参数
描述
immersive0
用户可以通过指向或滑过屏幕边缘来访问系统 UI(如任务栏和窗口框架)
plain1
用户无法使用鼠标/触摸访问系统 UI
指定 surface 在全屏模式下的行为

[已弃用] 此 surface 进入全屏时可能的窗口系统行为。

snap_direction { none, left, right } 
参数
描述
none0
left1
right2
surface 吸附方向

Surface 吸附方向。

occlusion_state { unknown, visible, occluded, hidden } 
参数
描述
unknown0
未跟踪 surface 的遮挡状态
visible1
surface 可见
occluded2
surface 被遮挡
hidden3
surface 不可见
surface 遮挡状态

描述 surface 的遮挡状态。

tooltip_trigger { cursor, keyboard } 
参数
描述
cursor0
由光标触发
keyboard1
由键盘触发
工具提示触发类型

描述触发工具提示的方式。


zaura_output

版本 45
aura shell 的 wl_output 接口

对 wl_output 对象的附加接口,允许客户端访问 aura shell 的 output 特定功能。

release
类型: destructor起始版本 38
release()
销毁 zaura_output

销毁此 zaura_shell 对象。

当由此 zaura_shell 对象实例创建的 zaura_surface 仍然存在时,销毁已绑定的 zaura_shell 对象是非法的,并将导致协议错误。

有关析构函数命名,请参阅 zaura_shell.release。

scale
起始版本 2
参数
类型
描述
flagsuint<zaura_output.scale_property>
bitfield of scale flags
scaleuint<zaura_output.scale_factor>
output scale
公布输出的可用缩放比例

scale 事件描述输出的可用缩放比例。

绑定到 output 对象时发送该事件,始终会有一个缩放比例,即当前缩放比例。如果输出更改缩放比例,将再次发送该事件,表示当前的缩放比例。换句话说,当前缩放比例始终是最后收到的带有 current 标志的缩放比例。

参数
类型
描述
connectionuint<zaura_output.connection_type>
output connection
公布输出的连接信息

connection 事件描述输出的连接方式。

绑定到 output 对象时发送该事件。

device_scale_factor(scale: uint<zaura_output.scale_factor>)
参数
类型
描述
scaleuint<zaura_output.scale_factor>
output device scale factor
公布输出的设备缩放因子

此事件描述输出的设备特定缩放因子。

设备特定缩放因子在输出的生命周期内不会改变。它不像 wl_output 接口提供的缩放因子那样仅限于整数值。通过将此设备缩放因子与当前输出缩放相结合,可以确定 compositor 使用的精确内容缩放。

绑定到 output 对象时发送该事件。

insets
起始版本 33
insets(top: int, left: int, bottom: int, right: int)
参数
类型
描述
topint
leftint
bottomint
rightint
公布输出的工作区域内边距

此事件以逻辑屏幕坐标描述输出的内边距,据此可以计算工作区域。

此事件在 wl_output.done 之前发送,客户端将在之后应用更改。

logical_transform(transform: int<wl_output.transform>)
参数
类型
描述
transformint<wl_output.transform>
公布输出的逻辑变换

此事件描述输出的逻辑变换。wl_output.geometry 的变换对应于显示器面板的旋转,而逻辑变换对应于显示器的逻辑旋转。

此事件在 wl_output.done 之前发送,客户端将在之后应用更改。

display_id(display_id_hi: uint, display_id_lo: uint)
参数
类型
描述
display_id_hiuint
display_id_louint
公布输出的显示 ID

此事件描述 ChromeOS 分配给每个显示器的 64 位显示 ID。该值是不透明的,不应进行解释。

activated()
新窗口的目标显示器

通知此输出现在是活动输出。通常在没有特定边界的情况下创建新窗口时用作目标显示器。

scale_property { current, preferred } 
参数
描述
current0x1
表示这是当前缩放比例
preferred0x2
表示这是首选缩放比例
缩放信息

这些标志描述输出缩放的属性。用于 scale 事件的标志位域中。

参数
描述
0400400
0500500
0550550
0600600
0625625
0650650
0700700
0750750
0800800
0850850
0900900
0950950
10001000
10501050
11001100
11501150
11251125
12001200
12501250
13001300
14001400
14501450
15001500
16001600
17501750
18001800
20002000
22002200
22502250
25002500
27502750
30003000
35003500
40004000
45004500
50005000
connection_type { unknown, internal } 
参数
描述
unknown0
internal1

aura shell 的 toplevel shell 接口

对 toplevel shell 的接口,允许客户端访问 shell 特定功能。

为远程 surface 设置方向锁定

当此 surface 处于全屏状态时请求特定的方向行为。

surface_submission_in_pixel_coordinates()
surface 将以像素坐标提交

通知服务器在提交此 surface 时,此客户端不会使用 wl_surface_set_buffer_scale 来报告缩放比例,也不会通过 vp_viewporter 应用缩放。相反,服务器应应用适当的缩放变换以使提交的 buffer 正确合成。

set_supports_screen_coordinates()
在窗口边界中启用屏幕坐标

请求此操作将启用与 aura_toplevel 关联的 surface 中的屏幕坐标,包括子 surface 和将此 toplevel 作为父级添加的弹出窗口。应在首次 commit 之前设置。

set_window_bounds(x: int, y: int, width: int, height: int, output: object<wl_output>)
参数
类型
描述
xint
yint
widthint
heightint
outputobject<wl_output>允许为空
the output
设置窗口大小和位置

以 DP 屏幕坐标请求 surface 的新位置和边界。大小将应用于 set_geometry 中使用的可见边界。输出是 compositor 用于确定窗口应移动到哪个输出的提示。如果输出为 null,compositor 应仅根据给定边界做出决定。这些参数只是一个请求,compositor 可能会忽略、根据窗口管理器施加的规则调整大小和位置,或为将来的操作保留它。例如,compositor 不允许位置超出输出范围,或者如果 toplevel surface 处于最大化状态,compositor 可能只存储它,并在取消最大化时使用它。

set_restore_info(restore_session_id: int, restore_window_id: int)
参数
类型
描述
restore_session_idint
unique browser session id
restore_window_idint
restore browser window id
设置会话 ID 和恢复 ID

请求新创建的浏览器窗口的会话 ID 和恢复 ID。设置 compositor 用于在创建时恢复 toplevel surface 状态(如窗口位置、窗口状态)的信息。这不是双缓冲的,必须在发送首次 commit 之前设置。

set_system_modal()
使窗口成为系统模态

请求 toplevel surface 成为系统模态。compositor 将阻止其他窗口接收事件。如果有多个系统模态 surface,compositor 将决定哪个接收事件。

unset_system_modal()
取消窗口系统模态状态

请求取消 toplevel surface 的系统模态状态。compositor 将允许其他窗口接收事件。

set_restore_info_with_window_id_source(restore_session_id: int, restore_window_id_source: string)
参数
类型
描述
restore_session_idint
unique browser session id
restore_window_id_sourcestring
restore window id source
设置会话 ID 和恢复窗口 ID 来源

请求窗口的会话 ID 和恢复 ID。设置 compositor 用于在创建时恢复 toplevel surface 状态(如窗口位置、窗口状态)的信息。这不是双缓冲的,必须在发送首次 commit 之前设置。这与 set_restore_info 不同,用于创建多个与 restore_id_source 关联的窗口的客户端。

set_decoration(type: uint)
参数
类型
描述
typeuint
the new frame type
为 surface 请求装饰

允许客户端为 zaura_toplevel 请求特定装饰。服务器不必遵守此请求。有关可用选项,请参阅 decoration_type。必须在首次 commit 之前设置,否则后续请求可能不会被执行。自 M105 起可用。

release
类型: destructor起始版本 38
release()
销毁 zaura_toplevel

销毁此 zaura_toplevel 对象。当角色从 wl_surface 取消映射时,客户端应调用销毁。

有关析构函数命名,请参阅 zaura_shell.release。

set_float()
将 surface 浮动在顶部

[已弃用] 使用 set_float_to_location。 这是一个将 surface 置于其他 surface 之上的请求。

unset_float()
取消 surface 浮动

请求重置 surface 的浮动状态。

set_z_order(z_order: uint)
参数
类型
描述
z_orderuint
z order value for the window
设置窗口的 z 序

设置 toplevel surface 的 z 序。有关可用选项,请参阅 z_order_level。

set_origin(x: int, y: int, output: object<wl_output>)
参数
类型
描述
xint
yint
outputobject<wl_output>允许为空
output to contain the surface
以 DP 为单位设置窗口位置

以设备无关像素(DP)请求 surface 的新位置,相对于给定输出的左上角。

空输出表示当前包含 surface 的任何输出。

这些参数只是一个请求,compositor 可能会忽略它们,由于窗口管理器施加的规则而调整它们,或为将来的操作保留它们。例如,compositor 不允许位置超出输出范围;或者如果 toplevel surface 处于最大化状态,compositor 可能只存储它,并在取消最大化时使用它。

activate()
激活窗口

激活此窗口。这相当于将窗口带到前台。如果 compositor 认为客户端行为不当,可以忽略此请求。

deactivate()
停用窗口

停用此窗口。这相当于请求该窗口不成为前台窗口。确切行为由 compositor 定义。如果 compositor 认为客户端行为不当,可以忽略此请求。

set_fullscreen_mode(mode: uint<zaura_toplevel.fullscreen_mode>)
参数
类型
描述
modeuint<zaura_toplevel.fullscreen_mode>
设置 surface 在全屏模式下的行为

建议窗口管理器在此 surface 进入全屏时的行为方式。不会使 surface 进入全屏。

确切地说,如果 surface 尚未处于全屏状态,切换模式从客户端角度来看不会立即产生影响,但会改变下次请求使 surface 进入全屏时的行为。 如果 surface 已经处于全屏状态,则此请求会立即生效,在普通和沉浸式全屏模式之间切换。

set_scale_factor(scale_factor_as_uint: uint)
参数
类型
描述
scale_factor_as_uintuint
允许客户端为将来的 buffer commit 设置缩放因子

客户端有一个与每个 zaura toplevel 关联的 32 位浮点缩放因子。此缩放因子必须精确传播到 exo。为此,我们 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。为避免冗余消息,此请求仅需在 zaura toplevel 缩放因子更改时调用一次。这是双缓冲状态,将在下一次 commit 中应用。

set_snap_primary(snap_ratio_as_uint: uint)
参数
类型
描述
snap_ratio_as_uintuint
将 surface 吸附到主吸附位置

请求将 surface 吸附到左侧或顶部(如果是主布局),否则吸附到右侧或底部。

set_snap_secondary(snap_ratio_as_uint: uint)
参数
类型
描述
snap_ratio_as_uintuint
将 surface 吸附到次吸附位置

请求将 surface 吸附到右侧或底部(如果是主布局),否则吸附到左侧或顶部。

客户端有意吸附 surface

通知(或告知)服务器客户端有吸附窗口的意图。要告知不再愿意吸附,请发送 'none'。

unset_snap()
取消窗口吸附

请求取消窗口的吸附状态。

set_persistable(persistable: uint<zaura_toplevel.persistable>)
参数
类型
描述
persistableuint<zaura_toplevel.persistable>
is the argument persistable
描述窗口是否可持久化

请求窗口的可持久化状态。在窗口属性中设置窗口的可持久化状态。应在首次 commit 之前调用。

set_shape(region: object<wl_region>)
参数
类型
描述
regionobject<wl_region>允许为空
以 DP 为单位设置 surface 的形状

以 DP 为单位设置 toplevel 窗口的形状。传入 NULL 将重置窗口的形状。

此方法仅应用于支持现有的(已弃用的)Chrome Apps SetShape API,不应用于任何其他目的。

set_top_inset(height: int)
参数
类型
描述
heightint
Top inset of client window. Should be non negative.
为 surface 设置顶部内边距

为 surface 设置顶部内边距。这表示标题栏高度,应为非负值。

ack_rotate_focus(serial: uint, handled: uint<zaura_toplevel.rotate_handled_state>)
参数
类型
描述
serialuint
serial for the original; rotation event
handleduint<zaura_toplevel.rotate_handled_state>
whether or not the rotation was successful
旋转焦点事件的状态

如果焦点已成功在 surface 内部的 UI 元素之间旋转,客户端回复 'handled'。如果焦点未旋转,客户端回复 'not_handled'。服务器可使用此信息将焦点移动到下一个可聚焦的 surface。

请注意,客户端处理中的延迟可能导致服务器收到过时的确认。

set_can_maximize()
提示 toplevel surface 可以最大化

向窗口管理器提示 toplevel surface 可以最大化。

unset_can_maximize()
提示 toplevel surface 不应被最大化

向窗口管理器提示 toplevel surface 不应被最大化。请注意,窗口管理器仍可能请求客户端最大化。在这种情况下,客户端应尊重窗口管理器的请求并最大化。之后可以取消最大化状态。

set_can_fullscreen()
提示 toplevel surface 可以进入全屏

向窗口管理器提示 toplevel surface 可以进入全屏。

unset_can_fullscreen()
提示 toplevel surface 不应进入全屏

向窗口管理器提示 toplevel surface 不应进入全屏。请注意,窗口管理器仍可能请求客户端进入全屏。在这种情况下,客户端应尊重窗口管理器的请求并进入全屏。之后可以退出全屏。

set_float_to_location(mode: uint<zaura_toplevel.float_start_location>)
将 surface 浮动在顶部

这是一个将 surface 置于其他 surface 之上的请求。

set_window_corner_radii(upper_left_radius: uint, upper_right_radius: uint, lower_right_radius: uint, lower_left_radius: uint)
请求为 surface 的窗口应用圆角

客户端以 DP(设备无关像素)为单位指定要应用于窗口的每个圆角的半径。

窗口圆角半径是双缓冲的,将在调用相应 wl_surface 的 wl_surface.commit 时应用。

注意:圆角半径会影响 wl_surface 树,包括子 surface。一旦调用此协议,surface 将无法设置自己的圆角边界,因为圆角窗口边界将应用于整个 surface 树。

set_shadow_corner_radii(upper_left_radius: uint, upper_right_radius: uint, lower_right_radius: uint, lower_left_radius: uint)
请求为 surface 的阴影应用圆角

客户端以设备无关像素(DP)为单位指定要应用于与 aura toplevel surface 关联的阴影的每个圆角半径。

阴影圆角半径是双缓冲的,将在调用相应 wl_surface 的 wl_surface.commit 时应用。

configure(x: int, y: int, width: int, height: int, states: array)
参数
类型
描述
xint
yint
widthint
heightint
statesarray
建议 surface 更改

配置更改,还包括以屏幕坐标表示的窗口原点。

origin_change(x: int, y: int)
参数
类型
描述
xint
yint
窗口原点更改

当窗口原点发生变化时发送的通知。与 configure 不同,这不意味着客户端需要调整大小。值以屏幕坐标表示。

configure_raster_scale(scale: uint)
参数
类型
描述
scaleuint
Raster scale, in float format
在 configure 期间设置光栅缩放比例

设置此窗口的光栅缩放比例。应在 configure 事件序列期间调用。为此,我们 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。

参数
类型
描述
serialuint
serial for the rotation event
directionuint<zaura_toplevel.rotate_direction>
the direction for linear traversal
restartuint<zaura_toplevel.rotate_restart_state>
whether or not to restart traversal
在窗口内旋转焦点

在 toplevel 窗口内旋转焦点。窗口必须将其可聚焦视图排序为稳定且线性可遍历的顺序。在旋转焦点之前,surface 应已被激活并拥有键盘焦点。如果 surface 未被激活或没有键盘焦点,服务器应首先激活并为窗口输入键盘焦点。事件顺序示例可能是:

1. 激活 surface 2. 输入键盘焦点 3. 旋转焦点

如果窗口未被激活或没有键盘焦点,客户端应回复 "not handled" 且不执行任何操作。

要开始新的旋转序列,服务器将 "restart" 参数设置为 true。如果 "restart" 参数为 true,窗口应将焦点设置在给定方向的第一个 UI 元素上,不执行任何旋转。

客户端应通过 "ack_rotate_focus" 请求中的 "handled" 字段回复旋转是否成功。客户端应在确认消息中传递事件序列号和方向。

overview_change(in_overview: uint<zaura_toplevel.in_overview>)
参数
类型
描述
in_overviewuint<zaura_toplevel.in_overview>
in overview or not
窗口处于概览中

窗口正在概览模式中显示。请注意,这与 shell 概览状态不同,因为并非所有窗口都是概览网格的一部分。

configure_occlusion_state(mode: uint<zaura_toplevel.occlusion_state>)
参数
类型
描述
modeuint<zaura_toplevel.occlusion_state>
在 configure 期间设置遮挡状态

设置此窗口的遮挡状态。应在 configure 事件序列期间调用。当遮挡状态需要作为同步操作设置时使用此事件,与非同步的 occlusion_state_changed 不同。例如,可用于将窗口标记为隐藏以便释放资源。当再次使其可见时,可能需要一些时间来重新创建 buffer,这就是为什么此操作需要同步。

参数
描述
none1
无方向锁定
portrait2
主或次纵向
landscape3
主或次横向
current4
保持当前方向
portrait_primary5
主纵向
landscape_primary6
主横向
portrait_secondary7
次纵向
landscape_secondary8
次横向
方向锁定请求

定义 surface 处于全屏状态时的方向请求。

参数
描述
immersive起始版本 36100
隐藏标题栏和任务栏的沉浸模式

用户可以通过指向或滑过屏幕边缘来访问系统 UI(如任务栏和窗口框架)。

minimized起始版本 36101
surface 已最小化

窗口已被最小化。

snapped_primary起始版本 38102
窗口吸附在主位置

如果显示器处于横向模式,窗口吸附到左侧;如果处于纵向模式,窗口吸附到顶部。

snapped_secondary起始版本 38103
窗口吸附在次位置

如果显示器处于横向模式,窗口吸附到右侧;如果处于纵向模式,窗口吸附到底部。

floated起始版本 38104
窗口浮动在顶部

窗口浮动在其他窗口之上。每个桌面允许一个浮动窗口。当同一桌面上已有浮动窗口时浮动新窗口,将取消原有浮动窗口的浮动状态。

pip起始版本 54105
窗口处于画中画

窗口处于画中画模式。

pinned起始版本 64106
窗口已被固定

窗口已被固定。

trusted_pinned起始版本 64107
窗口已被受信任固定

窗口已被受信任固定。

对 xdg 状态的补充 aura 状态

此处包含的状态是对 XDG shell 和特定 aura 窗口中定义的状态的补充。

decoration_type { none, normal, shadow } 
参数
描述
none0
无帧
normal1
带阴影的标题栏
shadow2
仅阴影
不同的装饰类型

装饰类型用于修改 surface(例如投影阴影)。

参数
描述
normal0
窗口的默认级别
floating_window1
浮动窗口 z 序高于其他普通窗口
floating_ui_element2
用于显示在浮动窗口之上的非窗口样式 UI
security_surface3
不能被干扰或覆盖
窗口的 z 序级别

用于设置 toplevel surface 的不同 z 序级别。

fullscreen_mode { plain, immersive } 
参数
描述
plain0
用户无法使用鼠标/触摸访问系统 UI
immersive1
用户可以通过指向或滑过屏幕边缘来访问系统 UI(如任务栏和窗口框架)
指定 surface 在全屏模式下的行为

此 surface 进入全屏时可能的窗口系统行为。

snap_direction { none, primary, secondary } 
参数
描述
none0
取消窗口吸附
primary1
将窗口吸附到主布局的左侧或顶部,次布局的右侧或底部
secondary2
将窗口吸附到主布局的右侧或底部,次布局的顶部或左侧
窗口吸附方向

窗口吸附方向。

persistable { not_persistable, persistable } 
参数
描述
not_persistable0
值不可持久化
persistable1
值可持久化
描述值是否可持久化

二进制枚举映射为布尔值,描述值是否可持久化。

float_start_location { bottom_right, bottom_left } 
参数
描述
bottom_right0
浮动时,surface 移动到工作区域的右下角。这是默认值。
bottom_left1
浮动时,surface 移动到工作区域的左下角。
指定刚被浮动的 surface 的位置

surface 被浮动时可能的起始位置。

in_overview { not_in_overview, in_overview } 
参数
描述
not_in_overview0
值不在概览中
in_overview1
值在概览中
描述值是否在概览中

二进制枚举映射为布尔值,描述值是否在概览中。


zaura_popup

版本 46
aura shell 的 popup shell 接口

对 popup shell 的接口,允许客户端访问 shell 特定功能。

surface_submission_in_pixel_coordinates()
surface 将以像素坐标提交

通知服务器在提交此 surface 时,此客户端不会使用 wl_surface_set_buffer_scale 来报告缩放比例,也不会通过 vp_viewporter 应用缩放。相反,服务器应应用适当的缩放变换以使提交的 buffer 正确合成。

set_decoration(type: uint)
参数
类型
描述
typeuint
the new frame type
为 surface 请求装饰

允许客户端为 zaura_toplevel 请求特定装饰。服务器不必遵守此请求。有关可用选项,请参阅 decoration_type。自 M105 起可用。

set_menu
起始版本 37
set_menu()
将弹出类型设置为菜单

将弹出类型设置为菜单。

release
类型: destructor起始版本 38
release()
销毁 zaura_popup

此请求销毁 zaura_popup。当角色从 wl_surface 取消映射时,客户端应调用销毁。

有关析构函数命名,请参阅 zaura_shell.release。

set_scale_factor(scale_factor_as_uint: uint)
参数
类型
描述
scale_factor_as_uintuint
允许客户端为将来的 buffer commit 设置缩放因子

客户端有一个与每个 zaura popup 关联的 32 位浮点缩放因子。此缩放因子必须精确传播到 exo。为此,我们 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。为避免冗余消息,此请求仅需在 zaura popup 的缩放因子更改时调用一次。

decoration_type { none, normal, shadow } 
参数
描述
none0
无帧
normal1
带阴影的标题栏
shadow2
仅阴影
不同的装饰类型

装饰类型用于修改 surface(例如投影阴影)。


aura shell 的输出管理器接口

[已弃用] 自 M122 起弃用。请参阅 zaura_output_manager_v2 接口。

负责确保客户端在绑定 wl_output 后立即以及随后需要时拥有给定输出的完整状态视图的全局接口。

客户端可以预期给定 wl_output 的所有管理器事件在关联的 wl_output.done 事件之前到达。客户端必须在任何输出全局接口之前绑定到管理器全局接口。

done(output: object<wl_output>)
参数
类型
描述
outputobject<wl_output>
已发送关于输出的所有信息

此事件在给定 wl_output 的所有 zaura_output_manager 相关属性发送完毕后发送。

display_id(output: object<wl_output>, display_id_hi: uint, display_id_lo: uint)
参数
类型
描述
outputobject<wl_output>
display_id_hiuint
display_id_louint
公布输出的显示 ID

此事件描述 ChromeOS 分配给每个显示器的 64 位显示 ID。该值是不透明的,不应进行解释。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

logical_position(output: object<wl_output>, x: int, y: int)
参数
类型
描述
outputobject<wl_output>
xint
x position within the global compositor space
yint
y position within the global compositor space
输出在全局 compositor 空间中的位置

position 事件描述 wl_output 在全局 compositor 空间中的位置。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

logical_size(output: object<wl_output>, width: int, height: int)
参数
类型
描述
outputobject<wl_output>
widthint
width in global compositor space
heightint
height in global compositor space
输出在全局 compositor 空间中的大小

logical_size 事件描述输出在全局 compositor 空间中的逻辑大小。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

physical_size(output: object<wl_output>, width: int, height: int)
参数
类型
描述
outputobject<wl_output>
widthint
width in global compositor space
heightint
height in global compositor space
输出的像素大小

显示器的物理分辨率(以像素为单位)。该值不应包含任何过扫描内边距或显示旋转(面板方向调整除外)。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

insets(output: object<wl_output>, top: int, left: int, bottom: int, right: int)
参数
类型
描述
outputobject<wl_output>
topint
leftint
bottomint
rightint
公布输出的工作区域内边距

此事件以逻辑屏幕坐标描述输出的内边距,据此可以计算工作区域。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

device_scale_factor(output: object<wl_output>, device_scale_factor: uint)
参数
类型
描述
outputobject<wl_output>
device_scale_factoruint
display scale factor, in float format
公布输出的设备缩放因子

输出设备的缩放因子。我们将浮点缩放因子 reinterpret_cast 为 32 位 uint,稍后再转换回 float。这是因为 wayland 不支持浮点数的原生传输。由于不同的 CPU 架构可能对 IEEE 754 浮点数使用不同的字节序表示,此协议隐式假设调用方和接收方是同一台机器。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

logical_transform(output: object<wl_output>, transform: int<wl_output.transform>)
参数
类型
描述
outputobject<wl_output>
transformint<wl_output.transform>
transform that maps framebuffer to output
输出的逻辑变换

此事件描述输出的逻辑变换。面板变换对应于显示器面板的旋转,而逻辑变换对应于显示器的逻辑旋转。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

panel_transform(output: object<wl_output>, transform: int<wl_output.transform>)
参数
类型
描述
outputobject<wl_output>
transformint<wl_output.transform>
transform that maps framebuffer to output
输出的面板变换

此事件描述输出的面板变换,即关联显示器的面板旋转。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

name(output: object<wl_output>, name: string)
参数
类型
描述
outputobject<wl_output>
namestring
output name
此输出的可读名称

name 是一个 UTF-8 字符串,其内容没有定义的约定。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

description(output: object<wl_output>, description: string)
参数
类型
描述
outputobject<wl_output>
descriptionstring
output description
此输出的可读描述

description 是一个 UTF-8 字符串,其内容没有定义的约定。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。

activated(output: object<wl_output>)
参数
类型
描述
outputobject<wl_output>
新窗口的目标显示器

通知此输出现在是活动输出。通常在没有特定边界的情况下创建新窗口时用作目标显示器。

overscan_insets(output: object<wl_output>, top: int, left: int, bottom: int, right: int)
参数
类型
描述
outputobject<wl_output>
topint
leftint
bottomint
rightint
公布的输出过扫描内边距

此事件以物理像素描述输出的过扫描内边距。

绑定到 output 对象时发送该事件,随后在输出状态更改时发送。


合成器支持

未发现合成器支持

Copyright 2017 The Chromium Authors

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