XDG toplevel tag
为了使某些窗口属性(如位置、大小、"置顶"或用户定义的窗口行为规则)持久化,合成器需要一种方式来在应用程序重启后仍然识别窗口。此协议允许客户端通过为顶层窗口设置标签来实现这一点。
警告!此文件中描述的协议目前处于测试阶段。可能会添加向后兼容的更改,并更新相应的接口版本。向后不兼容的更改只能通过创建新的扩展主版本来完成。
set_toplevel_tag(toplevel: object<xdg_toplevel>, tag: string)
参数 | 类型 | 描述 |
|---|---|---|
| toplevel | object<xdg_toplevel> | |
| tag | string | untranslated tag |
为顶层窗口设置标签。标签可能会在用户界面中显示给用户,因此最好使其具有人类可读性,但它必须适用于配置文件且不应被翻译。 合适的标签例如"主窗口"、"设置"、"邮件撰写器"等。
标签不需要在应用程序之间唯一,客户端可以为多个窗口设置相同的标签,例如用户两次打开了相同的界面。可能由此产生的冲突如何处理取决于合成器的策略。
客户端应在关联的顶层窗口的初始提交中设置标签,但也可以在此后的任何时间设置,例如当顶层窗口的用途发生变化时。
set_toplevel_description(toplevel: object<xdg_toplevel>, description: string)
参数 | 类型 | 描述 |
|---|---|---|
| toplevel | object<xdg_toplevel> | |
| description | string | translated description |
为顶层窗口设置描述。此描述可能会在用户界面中显示给用户,或由屏幕阅读器朗读以满足无障碍需求,且应被翻译。 建议将描述设为标签的翻译。
客户端应在关联的顶层窗口的初始提交中设置描述,但也可以在此后的任何时间设置,例如当顶层窗口的用途发生变化时。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| xdg_toplevel_tag_manager_v1 | x | x | x | 1 | 1 | 1 | x | x | x | 1 | 1 | x | x | x | x | x | x | x |
Copyright
Copyright © 2024 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.