get notifications of other elements overlapping layer surfaces

The purpose of this protocol is to enable layer-shell client to get notifications if part of their surfaces are occluded other elements (currently toplevels and other layer-surfaces).

You can request a notification object for any of your zwlr_layer_surface_v1 surfaces, which will then emit overlap events.

get notified if a layer-shell is obstructed by a toplevel

Requests notifications for toplevels and layer-surfaces entering and leaving the surface-area of the given zwlr_layer_surface_v1. This can be used e.g. to implement auto-hide functionality.

To stop receiving notifications, destroy the returned zcosmic_overlap_notification_v1 object.


Subscription for overlapping toplevels on a layer-surface
destroy()
destroy the notification object

This request should be called when the client has no interest in overlap notifications anymore.

toplevel_enter(toplevel: object<ext_foreign_toplevel_handle_v1>, x: int, y: int, width: int, height: int)
Argument
Type
Description
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 entered the surface area

A ext_foreign_toplevel_handle_v1 has entered the surface area.

This event will be emitted once for every ext_foreign_toplevel_handle_v1 representing this toplevel.

Compositors are free to update the overlapping area by sending additional `toplevel_enter` events for the same toplevel without sending `toplevel_leave` in between.

toplevel_leave(toplevel: object<ext_foreign_toplevel_handle_v1>)
Argument
Type
Description
toplevelobject<ext_foreign_toplevel_handle_v1>
Toplevel entered the surface area

A ext_foreign_toplevel_handle_v1 has left the surface area.

This event will be emitted once for every ext_foreign_toplevel_handle_v1 representing this toplevel.

layer_enter(identifier: string, namespace: string, exclusive: uint, layer: uint<zwlr_layer_shell_v1.layer>, x: int, y: int, width: int, height: int)
Argument
Type
Description
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 entered the surface area

A zwlr_layer_surface_v1 has entered the surface area.

Compositors are free to update the overlapping area by sending additional `layer_enter` events for the same surface without sending `layer_leave` in between.

The overlapping region is given surface-relative to the zwlr_layer_surface_v1 used to create this notification object.

layer_leave(identifier: string)
Argument
Type
Description
identifierstring
unique identifier for the overlapping layer-surface
Layer surface left the surface area

A zwlr_layer_surface_v1 has left the surface area.


Compositor Support

Mutter
Mutter
48.0
KWin
KWin
6.4
Sway
Sway
1.11
COSMIC
COSMIC
...
Hyprland
Hyprland
0.48
niri
25.02
Weston
Weston
14
Labwc
Labwc
0.9.0
Cage
Cage
0.2.0
Wayfire
Wayfire
0.9.0
GameScope
GameScope
3.15.14
Jay
1.11.0
Mir
Mir
2.19
Treeland
Treeland
0.5.20
Louvre
Louvre
2.14.1
zcosmic_overlap_notify_v1
x
x
x
1
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.