main
44ceea7 ยท 1 month ago 7 commits
  1<?xml version="1.0" encoding="UTF-8"?>
  2<protocol name="wlr_layer_shell_v1_unstable_v1">
  3
  4  <interface name="zwlr_layer_shell_v1" version="1">
  5    <description summary="create surfaces that are layers of the desktop">
  6      Clients can use this interface to assign the surface_layer role to
  7      wl_surfaces. Such surfaces are assigned to a "layer" of the output and
  8      rendered with a defined z-depth respective to each other. They may also be
  9      anchored to the edges and corners of a screen and specify input handling
 10      semantics. This interface should be suitable for the implementation of
 11      many desktop shell components, and a broad number of other applications
 12      that interact with the desktop.
 13    </description>
 14
 15    <request name="get_layer_surface">
 16      <description summary="create a layer_surface from a surface">
 17        Create a layer surface for an existing surface. This assigns the role of
 18        layer_surface, or raises a protocol error if another role is already
 19        assigned.
 20
 21        Creating a layer surface from a wl_surface which has a buffer attached
 22        or committed is a client error, and any attempts by a client to attach
 23        or manipulate a buffer prior to the first layer_surface.configure call
 24        must also be treated as errors.
 25
 26        You may pass NULL for output to allow the compositor to decide which
 27        output to use. Generally this will be the one that the user most
 28        recently interacted with.
 29
 30        Clients can specify a namespace that defines the purpose of the layer
 31        surface.
 32      </description>
 33      <arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/>
 34      <arg name="surface" type="object" interface="wl_surface"/>
 35      <arg name="output" type="object" interface="wl_output" allow-null="true"/>
 36      <arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/>
 37      <arg name="namespace" type="string" summary="namespace for the layer surface"/>
 38    </request>
 39
 40    <enum name="error">
 41      <entry name="role" value="0" summary="wl_surface has another role"/>
 42      <entry name="invalid_layer" value="1" summary="layer value is invalid"/>
 43      <entry name="already_constructed" value="2" summary="wl_surface has a buffer attached or committed"/>
 44    </enum>
 45
 46    <enum name="layer">
 47      <description summary="available layers for surfaces">
 48        These values indicate which layers a surface can be rendered in. They
 49        are ordered by z depth, bottom-most first. Traditional shell surfaces
 50        will typically be rendered between the bottom and top layers.
 51        Fullscreen shell surfaces are typically rendered at the top layer.
 52        Multiple surfaces can share a single layer, and ordering within a
 53        single layer is undefined.
 54      </description>
 55
 56      <entry name="background" value="0"/>
 57      <entry name="bottom" value="1"/>
 58      <entry name="top" value="2"/>
 59      <entry name="overlay" value="3"/>
 60    </enum>
 61  </interface>
 62
 63  <interface name="zwlr_layer_surface_v1" version="1">
 64    <description summary="layer metadata interface">
 65      An interface that may be implemented by a wl_surface, for surfaces that
 66      are designed to be rendered as a layer of a stacked desktop-like
 67      environment.
 68
 69      Layer surface state (size, anchor, exclusive zone, margin, interactivity)
 70      is double-buffered, and will be applied at the time wl_surface.commit of
 71      the corresponding wl_surface is called.
 72    </description>
 73
 74    <request name="set_size">
 75      <description summary="sets the size of the surface">
 76        Sets the size of the surface in surface-local coordinates. The
 77        compositor will display the surface centered with respect to its
 78        anchors.
 79
 80        If you pass 0 for either value, the compositor will assign it and
 81        inform you of the assignment in the configure event. You must set your
 82        anchor to opposite edges in the dimensions you omit; not doing so is a
 83        protocol error. Both values are 0 by default.
 84
 85        Size is double-buffered, see wl_surface.commit.
 86      </description>
 87      <arg name="width" type="uint"/>
 88      <arg name="height" type="uint"/>
 89    </request>
 90
 91    <request name="set_anchor">
 92      <description summary="configures the anchor point of the surface">
 93        Requests that the compositor anchor the surface to the specified edges
 94        and corners. If two orthoginal edges are specified (e.g. 'top' and
 95        'left'), then the anchor point will be the intersection of the edges
 96        (e.g. the top left corner of the output); otherwise the anchor point
 97        will be centered on that edge, or in the center if none is specified.
 98
 99        Anchor is double-buffered, see wl_surface.commit.
100      </description>
101      <arg name="anchor" type="uint" enum="anchor"/>
102    </request>
103
104    <request name="set_exclusive_zone">
105      <description summary="configures the exclusive geometry of this surface">
106        Requests that the compositor avoids occluding an area of the surface
107        with other surfaces. The compositor's use of this information is
108        implementation-dependent - do not assume that this region will not
109        actually be occluded.
110
111        A positive value is only meaningful if the surface is anchored to an
112        edge, rather than a corner. The zone is the number of surface-local
113        coordinates from the edge that are considered exclusive.
114
115        Surfaces that do not wish to have an exclusive zone may instead specify
116        how they should interact with surfaces that do. If set to zero, the
117        surface indicates that it would like to be moved to avoid occluding
118        surfaces with a positive excluzive zone. If set to -1, the surface
119        indicates that it would not like to be moved to accommodate for other
120        surfaces, and the compositor should extend it all the way to the edges
121        it is anchored to.
122
123        For example, a panel might set its exclusive zone to 10, so that
124        maximized shell surfaces are not shown on top of it. A notification
125        might set its exclusive zone to 0, so that it is moved to avoid
126        occluding the panel, but shell surfaces are shown underneath it. A
127        wallpaper or lock screen might set their exclusive zone to -1, so that
128        they stretch below or over the panel.
129
130        The default value is 0.
131
132        Exclusive zone is double-buffered, see wl_surface.commit.
133      </description>
134      <arg name="zone" type="int"/>
135    </request>
136
137    <request name="set_margin">
138      <description summary="sets a margin from the anchor point">
139        Requests that the surface be placed some distance away from the anchor
140        point on the output, in surface-local coordinates. Setting this value
141        for edges you are not anchored to has no effect.
142
143        The exclusive zone includes the margin.
144
145        Margin is double-buffered, see wl_surface.commit.
146      </description>
147      <arg name="top" type="int"/>
148      <arg name="right" type="int"/>
149      <arg name="bottom" type="int"/>
150      <arg name="left" type="int"/>
151    </request>
152
153    <request name="set_keyboard_interactivity">
154      <description summary="requests keyboard events">
155        Set to 1 to request that the seat send keyboard events to this layer
156        surface. For layers below the shell surface layer, the seat will use
157        normal focus semantics. For layers above the shell surface layers, the
158        seat will always give exclusive keyboard focus to the top-most layer
159        which has keyboard interactivity set to true.
160
161        Layer surfaces receive pointer, touch, and tablet events normally. If
162        you do not want to receive them, set the input region on your surface
163        to an empty region.
164
165        Events is double-buffered, see wl_surface.commit.
166      </description>
167      <arg name="keyboard_interactivity" type="uint"/>
168    </request>
169
170    <request name="get_popup">
171      <description summary="assign this layer_surface as an xdg_popup parent">
172        This assigns an xdg_popup's parent to this layer_surface.  This popup
173        should have been created via xdg_surface::get_popup with the parent set
174        to NULL, and this request must be invoked before committing the popup's
175        initial state.
176
177        See the documentation of xdg_popup for more details about what an
178        xdg_popup is and how it is used.
179      </description>
180      <arg name="popup" type="object" interface="xdg_popup"/>
181    </request>
182
183    <request name="ack_configure">
184      <description summary="ack a configure event">
185        When a configure event is received, if a client commits the
186        surface in response to the configure event, then the client
187        must make an ack_configure request sometime before the commit
188        request, passing along the serial of the configure event.
189
190        If the client receives multiple configure events before it
191        can respond to one, it only has to ack the last configure event.
192
193        A client is not required to commit immediately after sending
194        an ack_configure request - it may even ack_configure several times
195        before its next surface commit.
196
197        A client may send multiple ack_configure requests before committing, but
198        only the last request sent before a commit indicates which configure
199        event the client really is responding to.
200      </description>
201      <arg name="serial" type="uint" summary="the serial from the configure event"/>
202    </request>
203
204    <request name="destroy" type="destructor">
205      <description summary="destroy the layer_surface">
206        This request destroys the layer surface.
207      </description>
208    </request>
209
210    <event name="configure">
211      <description summary="suggest a surface change">
212        The configure event asks the client to resize its surface.
213
214        Clients should arrange their surface for the new states, and then send
215        an ack_configure request with the serial sent in this configure event at
216        some point before committing the new surface.
217
218        The client is free to dismiss all but the last configure event it
219        received.
220
221        The width and height arguments specify the size of the window in
222        surface-local coordinates.
223
224        The size is a hint, in the sense that the client is free to ignore it if
225        it doesn't resize, pick a smaller size (to satisfy aspect ratio or
226        resize in steps of NxM pixels). If the client picks a smaller size and
227        is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the
228        surface will be centered on this axis.
229
230        If the width or height arguments are zero, it means the client should
231        decide its own window dimension.
232      </description>
233      <arg name="serial" type="uint"/>
234      <arg name="width" type="uint"/>
235      <arg name="height" type="uint"/>
236    </event>
237
238    <event name="closed">
239      <description summary="surface should be closed">
240        The closed event is sent by the compositor when the surface will no
241        longer be shown. The output may have been destroyed or the user may
242        have asked for it to be removed. Further changes to the surface will be
243        ignored. The client should destroy the resource after receiving this
244        event, and create a new surface if they so choose.
245      </description>
246    </event>
247
248    <enum name="error">
249      <entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/>
250      <entry name="invalid_size" value="1" summary="size is invalid"/>
251      <entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/>
252    </enum>
253
254    <enum name="anchor" bitfield="true">
255      <entry name="top" value="1" summary="the top edge of the anchor rectangle"/>
256      <entry name="bottom" value="2" summary="the bottom edge of the anchor rectangle"/>
257      <entry name="left" value="4" summary="the left edge of the anchor rectangle"/>
258      <entry name="right" value="8" summary="the right edge of the anchor rectangle"/>
259    </enum>
260  </interface>
261</protocol>