KDE plasma shell
此接口由基于 KF5 的 Wayland shell 用于与合成器通信,只能绑定一次。
警告!此文件中描述的协议是桌面环境的实现细节。普通客户端不得使用此协议。可能会在不增加扩展主版本号的情况下进行不兼容的更改。
get_surface(id: new_id<org_kde_plasma_surface>, surface: object<wl_surface>)
参数 | 类型 | 描述 |
|---|---|---|
| id | new_id<org_kde_plasma_surface> | |
| surface | object<wl_surface> |
为已有的 surface 创建一个 shell surface。 一个 surface 只能关联一个 shell surface。
此接口可由 wl_surface 实现,用于提供 shell 用户界面。
它提供了设置 surface 角色、分配输出或在输出坐标中设置位置的请求。
在服务端,当关联的 wl_surface 被销毁时,该对象会自动销毁。在客户端,必须在销毁 wl_surface 对象之前调用 org_kde_plasma_surface.destroy()。
destroy()
The org_kde_plasma_surface interface is removed from the wl_surface object that was turned into a shell surface with the org_kde_plasma_shell.get_surface request. The shell surface role is lost and wl_surface is unmapped.
将输出分配给此 shell surface。合成器将在调用 org_kde_plasma_surface.set_position 请求时使用此信息来设置位置。
将 surface 移动到新坐标。
坐标是全局的,例如对于 1920,0+1920x1080 输出,50,50 在全局坐标空间中为 1970,50。
使用 org_kde_plasma_surface.set_output 为此 surface 分配输出。
set_role(role: uint)
参数 | 类型 | 描述 |
|---|---|---|
| role | uint |
为 shell surface 分配角色。
合成器根据 surface 的角色对其进行处理。参见下面的说明。
如果 surface 已有角色,此请求将失败,这意味着 surface 角色只能分配一次。
== 带有 splash 角色的 surface ==
Splash surface 在 shell 启动阶段放置在所有其他 surface 之上。
这些 surface 根据输出坐标放置。不会对这些 surface 施加大小限制,shell 需要根据输出大小调整它们的尺寸。
这些 surface 用于在启动阶段隐藏桌面,使用户始终看到准备就绪的桌面。
如果合成器以其他方式显示桌面(例如使用淡入效果),则 shell 可能不会创建 splash surface。
这取决于桌面通常需要多少时间准备工作区或特定的设计决策。本规范不强制任何特定设计。
当启动阶段完成后,shell 将向合成器发送 org_kde_plasma.desktop_ready 请求。
== 带有 desktop 角色的 surface ==
Desktop surface 放置在所有其他 surface 之下,用于显示带有图标、搜索结果或用户交互控件的实际桌面视图。显示内容取决于 shell 实现。
这些 surface 根据输出坐标放置。不会对这些 surface 施加大小限制,shell 需要根据输出大小调整它们的尺寸。
每个输出只能有一个 surface 具有 desktop 角色。
== 带有 dashboard 角色的 surface ==
Dashboard surface 放置在 desktop surface 之上,用于显示额外的小部件和控件。
这些 surface 根据输出坐标放置。不会对这些 surface 施加大小限制,shell 需要根据输出大小调整它们的尺寸。
每个输出只能有一个 surface 具有 dashboard 角色。
== 带有 config 角色的 surface ==
配置 surface 用于桌面配置。
set_panel_behavior(flag: uint)
参数 | 类型 | 描述 |
|---|---|---|
| flag | uint | panel_behavior enum value |
按 flag enum 中描述的设置标志位掩码。传入 0 以取消设置任何标志,surface 将恢复默认行为。
在 Plasma 6 中已弃用。设置此标志将不起作用。应用应在适当时使用 layer shell。
set_skip_taskbar(skip: uint)
参数 | 类型 | 描述 |
|---|---|---|
| skip | uint | Boolean value that sets whether to skip the taskbar |
将此位设置到窗口上,将使其表示倾向于不在任务栏中列出。任务栏实现可能会也可能不会遵循此提示。
panel_auto_hide_hide()
带有 panel_behavior auto_hide 的面板 surface 可以执行此请求,在不取消映射的情况下隐藏屏幕边缘的面板。合成器通过 auto_hidden_panel_hidden 事件通知客户端面板已被隐藏。
当指针触及面板边界的屏幕边缘时,合成器将恢复 surface 的可见性状态。一旦合成器恢复可见性,将发送 auto_hidden_panel_shown 事件。如果合成器无法隐藏面板,也会发送此事件。
客户端也可以使用 panel_auto_hide_show 请求再次显示面板。
panel_auto_hide_show()
带有 panel_behavior auto_hide 的面板 surface 可以执行此请求,再次显示通过 panel_auto_hide_hide 隐藏的面板。
set_panel_takes_focus(takes_focus: uint)
参数 | 类型 | 描述 |
|---|---|---|
| takes_focus | uint | Boolean value that sets whether the panel takes focus |
默认情况下,各种 org_kde_plasma_surface 角色不会获取焦点且无法激活。通过此请求,可以指示合成器将焦点也传递给此 org_kde_plasma_surface。
set_skip_switcher(skip: uint)
参数 | 类型 | 描述 |
|---|---|---|
| skip | uint | Boolean value that sets whether to skip the window switcher. |
设置此位将指示窗口倾向于不在切换器中列出。
open_under_cursor()
请求此 surface 的初始位置在当前光标位置下方。必须在向此 surface 附加任何缓冲区之前调用。
auto_hidden_panel_hidden()
自动隐藏面板已被合成器隐藏。
auto_hidden_panel_shown()
自动隐藏面板已被合成器显示。
role { normal, desktop, panel, onscreendisplay, notification, tooltip, criticalnotification, appletpopup }
参数 | 值 | 描述 |
|---|---|---|
| normal | 0 | |
| desktop | 1 | |
| panel | 2 | |
| onscreendisplay | 3 | |
| notification | 4 | |
| tooltip | 5 | |
| criticalnotification起始版本 6 | 6 | |
| appletpopup起始版本 8 | 7 |
panel_behavior { always_visible, auto_hide, windows_can_cover, windows_go_below }
参数 | 值 | 描述 |
|---|---|---|
| always_visible | 1 | 正常面板可见性 面板在其他 surface 之上,窗口不能覆盖(全屏窗口除外)。 The panel is on top of other surfaces, windows cannot cover (full screen windows excluded). |
| auto_hide | 2 | 自动隐藏 面板自动隐藏,鼠标悬停时恢复。 The panel is hidden automatically and restored when the mouse is over. |
| windows_can_cover | 3 | 窗口可以覆盖 窗口可以覆盖面板。 Windows can cover the panel. |
| windows_go_below | 4 | 窗口在下方 最大化窗口占据整个屏幕空间,但面板在窗口之上。 Maximized windows take the whole screen space but the panel is above the windows. |
error { panel_not_auto_hide }
参数 | 值 | 描述 |
|---|---|---|
| panel_not_auto_hide | 0 | 对非自动隐藏面板执行了 panel_auto_hide 请求。 |
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| org_kde_plasma_shell | x | x | x | x | x | 8 | x | x | x | x | x | x | x | x | x | x | x | x |
Copyright
SPDX-FileCopyrightText: 2013-2014 Pier Luigi Fiorini
SPDX-License-Identifier: LGPL-2.1-or-later