Go to index / Go to protocols

cosmic_overlap_notify_unstable_v1 ↗

cosmic_overlap_notify_unstable_v1
zcosmic_overlap_notify_v1

Version 1
Compositor Support
Version 1
cosmic 1.0.0

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.

zcosmic_overlap_notify_v1
request notify_on_overlap(
    overlap_notification: new_id<zcosmic_overlap_notification_v1>,
    layer_surface: object<zwlr_layer_surface_v1>,
)

    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.

    cosmic_overlap_notify_unstable_v1
    zcosmic_overlap_notification_v1

    Version 1

    Subscription for overlapping toplevels on a layer-surface

    zcosmic_overlap_notification_v1
    event toplevel_enter(
        toplevel: object<ext_foreign_toplevel_handle_v1>,
        x: int,
        y: int,
        width: int,
        height: int,
    )
    • x — x coordinate of the upper-left corner of the overlapping area
    • y — y coordinate of the upper-left corner of the overlapping area
    • width — width of the overlapping area
    • height — 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.

    zcosmic_overlap_notification_v1
    event toplevel_leave(
        toplevel: object<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.

      zcosmic_overlap_notification_v1
      event layer_enter(
          identifier: string,
          namespace: string,
          exclusive: uint,
          layer: uint<zwlr_layer_shell_v1.layer>,
          x: int,
          y: int,
          width: int,
          height: int,
      )
      • identifier — unique identifier for the overlapping layer-surface
      • namespace — namespace for the layer surface
      • exclusive — if the overlapping surface is requesting an exclusive area or not
      • layer — layer the overlapping surface sits on
      • x — x coordinate of the upper-left corner of the overlapping area
      • y — y coordinate of the upper-left corner of the overlapping area
      • width — width of the overlapping area
      • height — 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.

      zcosmic_overlap_notification_v1
      event layer_leave(
          identifier: string,
      )
      • identifier — unique identifier for the overlapping layer-surface

      Layer surface left the surface area

      A zwlr_layer_surface_v1 has left the surface area.

      zcosmic_overlap_notification_v1
      request destroy()
      Destructor

        destroy the notification object

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