获取其他元素遮挡 layer surface 的通知

此协议的目的是使 layer-shell 客户端能够在其 surface 部分被其他元素(目前为 toplevel 和其他 layer-surface)遮挡时获得通知。

你可以为任何 zwlr_layer_surface_v1 surface 请求通知对象,该对象将发出重叠事件。

当 layer-shell 被 toplevel 遮挡时获得通知

请求通知 toplevel 和 layer-surface 进入和离开给定 zwlr_layer_surface_v1 的 surface 区域。这可用于实现自动隐藏功能。

要停止接收通知,销毁返回的 zcosmic_overlap_notification_v1 对象。


订阅 layer-surface 上重叠的 toplevel
destroy()
销毁通知对象

当客户端不再对重叠通知感兴趣时,应调用此请求。

toplevel_enter(toplevel: object<ext_foreign_toplevel_handle_v1>, x: int, y: int, width: int, height: int)
参数
类型
描述
toplevelobject<ext_foreign_toplevel_handle_v1>
xint
x coordinate of the upper-left corner of the overlapping area
yint
y coordinate of the upper-left corner of the overlapping area
widthint
width of the overlapping area
heightint
height of the overlapping area
Toplevel 进入 surface 区域

一个 ext_foreign_toplevel_handle_v1 已进入 surface 区域。

此事件将为每个代表此 toplevel 的 ext_foreign_toplevel_handle_v1 发出一次。

Compositor 可以通过为同一 toplevel 发送额外的 toplevel_enter 事件来更新重叠区域,而无需在中间发送 toplevel_leave。

toplevel_leave(toplevel: object<ext_foreign_toplevel_handle_v1>)
参数
类型
描述
toplevelobject<ext_foreign_toplevel_handle_v1>
Toplevel 离开 surface 区域

一个 ext_foreign_toplevel_handle_v1 已离开 surface 区域。

此事件将为每个代表此 toplevel 的 ext_foreign_toplevel_handle_v1 发出一次。

layer_enter(identifier: string, namespace: string, exclusive: uint, layer: uint<zwlr_layer_shell_v1.layer>, x: int, y: int, width: int, height: int)
参数
类型
描述
identifierstring
unique identifier for the overlapping layer-surface
namespacestring
namespace for the layer surface
exclusiveuint
if the overlapping surface is requesting an exclusive area or not
layeruint<zwlr_layer_shell_v1.layer>
layer the overlapping surface sits on
xint
x coordinate of the upper-left corner of the overlapping area
yint
y coordinate of the upper-left corner of the overlapping area
widthint
width of the overlapping area
heightint
height of the overlapping area
Layer surface 进入 surface 区域

一个 zwlr_layer_surface_v1 已进入 surface 区域。

Compositor 可以通过为同一 surface 发送额外的 layer_enter 事件来更新重叠区域,而无需在中间发送 layer_leave。

重叠区域是相对于用于创建此通知对象的 zwlr_layer_surface_v1 的 surface 坐标给出的。

layer_leave(identifier: string)
参数
类型
描述
identifierstring
unique identifier for the overlapping layer-surface
Layer surface 离开 surface 区域

一个 zwlr_layer_surface_v1 已离开 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
zcosmic_overlap_notify_v1
x
1
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x

Copytight © 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.

Footer

© 2026 Wayland Explorer

本网站与 Wayland 官方项目无任何关联。网站所有内容均根据 Wayland 协议 XML 文件自动生成。

本网站使用的 Visual Studio Code - Codicons 遵循 CC BY 4.0 许可。