COSMIC overlap notify
此协议的目的是使 layer-shell 客户端能够在其 surface 部分被其他元素(目前为 toplevel 和其他 layer-surface)遮挡时获得通知。
你可以为任何 zwlr_layer_surface_v1 surface 请求通知对象,该对象将发出重叠事件。
notify_on_overlap(overlap_notification: new_id<zcosmic_overlap_notification_v1>, layer_surface: object<zwlr_layer_surface_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| overlap_notification | new_id<zcosmic_overlap_notification_v1> | |
| layer_surface | object<zwlr_layer_surface_v1> |
请求通知 toplevel 和 layer-surface 进入和离开给定 zwlr_layer_surface_v1 的 surface 区域。这可用于实现自动隐藏功能。
要停止接收通知,销毁返回的 zcosmic_overlap_notification_v1 对象。
toplevel_enter(toplevel: object<ext_foreign_toplevel_handle_v1>, x: int, y: int, width: int, height: int)
参数 | 类型 | 描述 |
|---|---|---|
| toplevel | object<ext_foreign_toplevel_handle_v1> | |
| x | int | x coordinate of the upper-left corner of the overlapping area |
| y | int | y coordinate of the upper-left corner of the overlapping area |
| width | int | width of the overlapping area |
| height | int | height of the overlapping area |
一个 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>)
参数 | 类型 | 描述 |
|---|---|---|
| toplevel | object<ext_foreign_toplevel_handle_v1> |
一个 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)
参数 | 类型 | 描述 |
|---|---|---|
| identifier | string | unique identifier for the overlapping layer-surface |
| namespace | string | namespace for the layer surface |
| exclusive | uint | if the overlapping surface is requesting an exclusive area or not |
| layer | uint<zwlr_layer_shell_v1.layer> | layer the overlapping surface sits on |
| x | int | x coordinate of the upper-left corner of the overlapping area |
| y | int | y coordinate of the upper-left corner of the overlapping area |
| width | int | width of the overlapping area |
| height | int | height of the overlapping area |
一个 zwlr_layer_surface_v1 已进入 surface 区域。
Compositor 可以通过为同一 surface 发送额外的 layer_enter 事件来更新重叠区域,而无需在中间发送 layer_leave。
重叠区域是相对于用于创建此通知对象的 zwlr_layer_surface_v1 的 surface 坐标给出的。
layer_leave(identifier: string)
参数 | 类型 | 描述 |
|---|---|---|
| identifier | string | unique identifier for the overlapping layer-surface |
一个 zwlr_layer_surface_v1 已离开 surface 区域。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| zcosmic_overlap_notify_v1 | x | 1 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
Copyright
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.