COSMIC toplevel info
此协议的目的是使任务栏或 dock 等客户端能够访问已打开应用程序的列表及其基本属性。
因此,它扩展了 ext_foreign_toplevel_v1,以在外部 toplevel 上提供更多信息和操作。
stop()
此请求表示客户端不再希望接收新 toplevel 的事件。但是,合成器可能会在发出 finished 事件之前继续发出 further toplevel_created 事件。
客户端在此请求之后不得再发送任何请求。
注意:绑定此协议版本 2 的客户端不需要此请求,将被忽略。
get_cosmic_toplevel(cosmic_toplevel: new_id<zcosmic_toplevel_handle_v1>, foreign_toplevel: object<ext_foreign_toplevel_handle_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| cosmic_toplevel | new_id<zcosmic_toplevel_handle_v1> | |
| foreign_toplevel | object<ext_foreign_toplevel_handle_v1> |
为现有的 ext_foreign_toplevel_handle_v1 请求 zcosmic_toplevel_handle_v1 扩展对象。
toplevel 的所有初始属性(状态等)将在此事件后立即通过 zcosmic_toplevel_handle_v1 中的相应事件发送。
toplevel(toplevel: new_id<zcosmic_toplevel_handle_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| toplevel | new_id<zcosmic_toplevel_handle_v1> |
此事件对于绑定此协议版本 2 的客户端永远不会发出,它们应改用 `get_cosmic_toplevel`。
此事件对于绑定版本 1 的客户端,每当创建新的 toplevel 窗口时发出。它对所有 toplevel 发出,无论创建它们的应用程序如何。
toplevel 的所有初始属性(标题、app_id、状态等)将在此事件后立即通过 zcosmic_toplevel_handle_v1 中的相应事件发送。
finished()
此事件表示合成器已完成向 zcosmic_toplevel_info_v1 发送事件。服务器将在此请求发送后立即销毁对象,因此它将变为无效,客户端应释放与之关联的任何资源。
注意:对于绑定此协议版本 2 的客户端,此事件在调用 `stop` 后立即发出,以保持向后兼容。
done()
在所有当前活动的 zcosmic_toplevel_handle_v1 的更改发送后发送此事件。
这使得对多个 zcosmic_toplevel_handle_v1 句柄及其属性的更改可以被视为原子操作,即使它们通过多个事件发生。
zcosmic_toplevel_handle_v1 对象代表一个打开的 toplevel 窗口。单个应用程序可能有多个打开的 toplevel。
每个 toplevel 都有一个它可见的输出列表,通过 output_enter 和 output_leave 事件向客户端公开。
destroy()
当客户端不再使用 zcosmic_toplevel_handle_v1 时,应调用此请求。
closed()
服务器在此事件之后不会在 zcosmic_toplevel_handle_v1 上发出进一步的事件。除了 destroy 请求之外收到的任何请求都将被忽略。收到此事件后,客户端应发出 destroy 请求以允许释放资源。
注意:对于绑定此协议版本 2 的客户端,不会发出此事件,因为 `ext_foreign_toplevel_handle_v1.closed` 是等效的。
done()
在 toplevel 状态的所有更改发送后发送此事件。
这使得对 zcosmic_toplevel_handle_v1 属性的更改可以被视为原子操作,即使它们通过多个事件发生。
注意:此事件不会在 closed 事件之后发送。
注意:对于绑定此协议版本 2 的客户端,不会发出此事件,因为 `ext_foreign_toplevel_handle_v1.done` 是等效的。
title(title: string)
参数 | 类型 | 描述 |
|---|---|---|
| title | string |
每当 toplevel 的标题更改时发出此事件。
注意:对于绑定此协议版本 2 的客户端,不会发出此事件,因为 `ext_foreign_toplevel_handle_v1.title` 是等效的。
app_id(app_id: string)
参数 | 类型 | 描述 |
|---|---|---|
| app_id | string |
每当 toplevel 的 app_id 更改时发出此事件。
注意:对于绑定此协议版本 2 的客户端,不会发出此事件,因为 `ext_foreign_toplevel_handle_v1.app_id` 是等效的。
每当 toplevel 在给定输出上变得可见时发出此事件。toplevel 可能在多个输出上可见。
每当 toplevel 在给定输出上不再可见时发出此事件。保证在此事件之前已发出具有相同输出的 output_enter 事件。
workspace_enter(workspace: object<zcosmic_workspace_handle_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| workspace | object<zcosmic_workspace_handle_v1> |
每当 toplevel 在给定工作区上变得可见时发出此事件。toplevel 可能在多个工作区上可见。
workspace_leave(workspace: object<zcosmic_workspace_handle_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| workspace | object<zcosmic_workspace_handle_v1> |
每当 toplevel 在给定工作区上不再可见时发出此事件。保证在此事件之前已发出具有相同工作区的 workspace_enter 事件。
state(state: array)
参数 | 类型 | 描述 |
|---|---|---|
| state | array |
在创建 zcosmic_toplevel_handle_v1 时发出一次,并在 toplevel 状态更改时再次发出。
参数 | 类型 | 描述 |
|---|---|---|
| output | object<wl_output> | |
| x | int | x coordinate of the upper-left corner |
| y | int | y coordinate of the upper-left corner |
| width | int | width of the toplevel |
| height | int | height of the toplevel |
当 toplevel 相对于提供的输出的几何形状(位置和/或大小)发生变化时发出。
此事件在创建 zcosmic_toplevel_handle_v1 时为每个已进入的输出发出一次,并在 toplevel 相对于任何输出的几何形状发生变化时再次发出。
ext_workspace_enter(workspace: object<ext_workspace_handle_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| workspace | object<ext_workspace_handle_v1> |
每当 toplevel 在给定工作区上变得可见时发出此事件。toplevel 可能在多个工作区上可见。
ext_workspace_leave(workspace: object<ext_workspace_handle_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| workspace | object<ext_workspace_handle_v1> |
每当 toplevel 在给定工作区上不再可见时发出此事件。保证在此事件之前已发出具有相同工作区的 workspace_enter 事件。
state { maximized, minimized, activated, fullscreen, sticky }
参数 | 值 | 描述 |
|---|---|---|
| maximized | 0 | toplevel 已最大化 |
| minimized | 1 | toplevel 已最小化 |
| activated | 2 | toplevel 处于活动状态 |
| fullscreen | 3 | toplevel 处于全屏状态 |
| sticky起始版本 2 | 4 | toplevel 是固定的 |
toplevel 可能具有的不同状态。这些状态与 xdg-toplevel 中定义的同名状态具有相同的含义。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| zcosmic_toplevel_info_v1 | x | 3 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
Copyright
Copyright © 2018 Ilia Bozhinov Copyright © 2020 Isaac Freund Copyright © 2024 Victoria Brekenfeld
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holders make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.