git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

protocol/upstream/wlr-layer-shell-unstable-v1.xml (18.9K)

  1 <!-- SPDX-License-Identifier: MIT -->
  2 <?xml version="1.0" encoding="UTF-8"?>
  3 <protocol name="wlr_layer_shell_unstable_v1">
  4   <copyright>
  5     Copyright © 2017 Drew DeVault
  6 
  7     Permission to use, copy, modify, distribute, and sell this
  8     software and its documentation for any purpose is hereby granted
  9     without fee, provided that the above copyright notice appear in
 10     all copies and that both that copyright notice and this permission
 11     notice appear in supporting documentation, and that the name of
 12     the copyright holders not be used in advertising or publicity
 13     pertaining to distribution of the software without specific,
 14     written prior permission.  The copyright holders make no
 15     representations about the suitability of this software for any
 16     purpose.  It is provided "as is" without express or implied
 17     warranty.
 18 
 19     THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 20     SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 21     FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 22     SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 23     WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 24     AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 25     ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 26     THIS SOFTWARE.
 27   </copyright>
 28 
 29   <interface name="zwlr_layer_shell_v1" version="5">
 30     <description summary="create surfaces that are layers of the desktop">
 31       Clients can use this interface to assign the surface_layer role to
 32       wl_surfaces. Such surfaces are assigned to a "layer" of the output and
 33       rendered with a defined z-depth respective to each other. They may also be
 34       anchored to the edges and corners of a screen and specify input handling
 35       semantics. This interface should be suitable for the implementation of
 36       many desktop shell components, and a broad number of other applications
 37       that interact with the desktop.
 38     </description>
 39 
 40     <request name="get_layer_surface">
 41       <description summary="create a layer_surface from a surface">
 42         Create a layer surface for an existing surface. This assigns the role of
 43         layer_surface, or raises a protocol error if another role is already
 44         assigned.
 45 
 46         Creating a layer surface from a wl_surface which has a buffer attached
 47         or committed is a client error, and any attempts by a client to attach
 48         or manipulate a buffer prior to the first layer_surface.configure call
 49         must also be treated as errors.
 50 
 51         After creating a layer_surface object and setting it up, the client
 52         must perform an initial commit without any buffer attached.
 53         The compositor will reply with a layer_surface.configure event.
 54         The client must acknowledge it and is then allowed to attach a buffer
 55         to map the surface.
 56 
 57         You may pass NULL for output to allow the compositor to decide which
 58         output to use. Generally this will be the one that the user most
 59         recently interacted with.
 60 
 61         Clients can specify a namespace that defines the purpose of the layer
 62         surface.
 63       </description>
 64       <arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/>
 65       <arg name="surface" type="object" interface="wl_surface"/>
 66       <arg name="output" type="object" interface="wl_output" allow-null="true"/>
 67       <arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/>
 68       <arg name="namespace" type="string" summary="namespace for the layer surface"/>
 69     </request>
 70 
 71     <enum name="error">
 72       <entry name="role" value="0" summary="wl_surface has another role"/>
 73       <entry name="invalid_layer" value="1" summary="layer value is invalid"/>
 74       <entry name="already_constructed" value="2" summary="wl_surface has a buffer attached or committed"/>
 75     </enum>
 76 
 77     <enum name="layer">
 78       <description summary="available layers for surfaces">
 79         These values indicate which layers a surface can be rendered in. They
 80         are ordered by z depth, bottom-most first. Traditional shell surfaces
 81         will typically be rendered between the bottom and top layers.
 82         Fullscreen shell surfaces are typically rendered at the top layer.
 83         Multiple surfaces can share a single layer, and ordering within a
 84         single layer is undefined.
 85       </description>
 86 
 87       <entry name="background" value="0"/>
 88       <entry name="bottom" value="1"/>
 89       <entry name="top" value="2"/>
 90       <entry name="overlay" value="3"/>
 91     </enum>
 92 
 93     <!-- Version 3 additions -->
 94 
 95     <request name="destroy" type="destructor" since="3">
 96       <description summary="destroy the layer_shell object">
 97         This request indicates that the client will not use the layer_shell
 98         object any more. Objects that have been created through this instance
 99         are not affected.
100       </description>
101     </request>
102   </interface>
103 
104   <interface name="zwlr_layer_surface_v1" version="5">
105     <description summary="layer metadata interface">
106       An interface that may be implemented by a wl_surface, for surfaces that
107       are designed to be rendered as a layer of a stacked desktop-like
108       environment.
109 
110       Layer surface state (layer, size, anchor, exclusive zone,
111       margin, interactivity) is double-buffered, and will be applied at the
112       time wl_surface.commit of the corresponding wl_surface is called.
113 
114       Attaching a null buffer to a layer surface unmaps it.
115 
116       Unmapping a layer_surface means that the surface cannot be shown by the
117       compositor until it is explicitly mapped again. The layer_surface
118       returns to the state it had right after layer_shell.get_layer_surface.
119       The client can re-map the surface by performing a commit without any
120       buffer attached, waiting for a configure event and handling it as usual.
121     </description>
122 
123     <request name="set_size">
124       <description summary="sets the size of the surface">
125         Sets the size of the surface in surface-local coordinates. The
126         compositor will display the surface centered with respect to its
127         anchors.
128 
129         If you pass 0 for either value, the compositor will assign it and
130         inform you of the assignment in the configure event. You must set your
131         anchor to opposite edges in the dimensions you omit; not doing so is a
132         protocol error. Both values are 0 by default.
133 
134         Size is double-buffered, see wl_surface.commit.
135       </description>
136       <arg name="width" type="uint"/>
137       <arg name="height" type="uint"/>
138     </request>
139 
140     <request name="set_anchor">
141       <description summary="configures the anchor point of the surface">
142         Requests that the compositor anchor the surface to the specified edges
143         and corners. If two orthogonal edges are specified (e.g. 'top' and
144         'left'), then the anchor point will be the intersection of the edges
145         (e.g. the top left corner of the output); otherwise the anchor point
146         will be centered on that edge, or in the center if none is specified.
147 
148         Anchor is double-buffered, see wl_surface.commit.
149       </description>
150       <arg name="anchor" type="uint" enum="anchor"/>
151     </request>
152 
153     <request name="set_exclusive_zone">
154       <description summary="configures the exclusive geometry of this surface">
155         Requests that the compositor avoids occluding an area with other
156         surfaces. The compositor's use of this information is
157         implementation-dependent - do not assume that this region will not
158         actually be occluded.
159 
160         A positive value is only meaningful if the surface is anchored to one
161         edge or an edge and both perpendicular edges. If the surface is not
162         anchored, anchored to only two perpendicular edges (a corner), anchored
163         to only two parallel edges or anchored to all edges, a positive value
164         will be treated the same as zero.
165 
166         A positive zone is the distance from the edge in surface-local
167         coordinates to consider exclusive.
168 
169         Surfaces that do not wish to have an exclusive zone may instead specify
170         how they should interact with surfaces that do. If set to zero, the
171         surface indicates that it would like to be moved to avoid occluding
172         surfaces with a positive exclusive zone. If set to -1, the surface
173         indicates that it would not like to be moved to accommodate for other
174         surfaces, and the compositor should extend it all the way to the edges
175         it is anchored to.
176 
177         For example, a panel might set its exclusive zone to 10, so that
178         maximized shell surfaces are not shown on top of it. A notification
179         might set its exclusive zone to 0, so that it is moved to avoid
180         occluding the panel, but shell surfaces are shown underneath it. A
181         wallpaper or lock screen might set their exclusive zone to -1, so that
182         they stretch below or over the panel.
183 
184         The default value is 0.
185 
186         Exclusive zone is double-buffered, see wl_surface.commit.
187       </description>
188       <arg name="zone" type="int"/>
189     </request>
190 
191     <request name="set_margin">
192       <description summary="sets a margin from the anchor point">
193         Requests that the surface be placed some distance away from the anchor
194         point on the output, in surface-local coordinates. Setting this value
195         for edges you are not anchored to has no effect.
196 
197         The exclusive zone includes the margin.
198 
199         Margin is double-buffered, see wl_surface.commit.
200       </description>
201       <arg name="top" type="int"/>
202       <arg name="right" type="int"/>
203       <arg name="bottom" type="int"/>
204       <arg name="left" type="int"/>
205     </request>
206 
207     <enum name="keyboard_interactivity">
208       <description summary="types of keyboard interaction possible for a layer shell surface">
209         Types of keyboard interaction possible for layer shell surfaces. The
210         rationale for this is twofold: (1) some applications are not interested
211         in keyboard events and not allowing them to be focused can improve the
212         desktop experience; (2) some applications will want to take exclusive
213         keyboard focus.
214       </description>
215 
216       <entry name="none" value="0">
217         <description summary="no keyboard focus is possible">
218           This value indicates that this surface is not interested in keyboard
219           events and the compositor should never assign it the keyboard focus.
220 
221           This is the default value, set for newly created layer shell surfaces.
222 
223           This is useful for e.g. desktop widgets that display information or
224           only have interaction with non-keyboard input devices.
225         </description>
226       </entry>
227       <entry name="exclusive" value="1">
228         <description summary="request exclusive keyboard focus">
229           Request exclusive keyboard focus if this surface is above the shell surface layer.
230 
231           For the top and overlay layers, the seat will always give
232           exclusive keyboard focus to the top-most layer which has keyboard
233           interactivity set to exclusive. If this layer contains multiple
234           surfaces with keyboard interactivity set to exclusive, the compositor
235           determines the one receiving keyboard events in an implementation-
236           defined manner. In this case, no guarantee is made when this surface
237           will receive keyboard focus (if ever).
238 
239           For the bottom and background layers, the compositor is allowed to use
240           normal focus semantics.
241 
242           This setting is mainly intended for applications that need to ensure
243           they receive all keyboard events, such as a lock screen or a password
244           prompt.
245         </description>
246       </entry>
247       <entry name="on_demand" value="2" since="4">
248         <description summary="request regular keyboard focus semantics">
249           This requests the compositor to allow this surface to be focused and
250           unfocused by the user in an implementation-defined manner. The user
251           should be able to unfocus this surface even regardless of the layer
252           it is on.
253 
254           Typically, the compositor will want to use its normal mechanism to
255           manage keyboard focus between layer shell surfaces with this setting
256           and regular toplevels on the desktop layer (e.g. click to focus).
257           Nevertheless, it is possible for a compositor to require a special
258           interaction to focus or unfocus layer shell surfaces (e.g. requiring
259           a click even if focus follows the mouse normally, or providing a
260           keybinding to switch focus between layers).
261 
262           This setting is mainly intended for desktop shell components (e.g.
263           panels) that allow keyboard interaction. Using this option can allow
264           implementing a desktop shell that can be fully usable without the
265           mouse.
266         </description>
267       </entry>
268     </enum>
269 
270     <request name="set_keyboard_interactivity">
271       <description summary="requests keyboard events">
272         Set how keyboard events are delivered to this surface. By default,
273         layer shell surfaces do not receive keyboard events; this request can
274         be used to change this.
275 
276         This setting is inherited by child surfaces set by the get_popup
277         request.
278 
279         Layer surfaces receive pointer, touch, and tablet events normally. If
280         you do not want to receive them, set the input region on your surface
281         to an empty region.
282 
283         Keyboard interactivity is double-buffered, see wl_surface.commit.
284       </description>
285       <arg name="keyboard_interactivity" type="uint" enum="keyboard_interactivity"/>
286     </request>
287 
288     <request name="get_popup">
289       <description summary="assign this layer_surface as an xdg_popup parent">
290         This assigns an xdg_popup's parent to this layer_surface.  This popup
291         should have been created via xdg_surface::get_popup with the parent set
292         to NULL, and this request must be invoked before committing the popup's
293         initial state.
294 
295         See the documentation of xdg_popup for more details about what an
296         xdg_popup is and how it is used.
297       </description>
298       <arg name="popup" type="object" interface="xdg_popup"/>
299     </request>
300 
301     <request name="ack_configure">
302       <description summary="ack a configure event">
303         When a configure event is received, if a client commits the
304         surface in response to the configure event, then the client
305         must make an ack_configure request sometime before the commit
306         request, passing along the serial of the configure event.
307 
308         If the client receives multiple configure events before it
309         can respond to one, it only has to ack the last configure event.
310 
311         A client is not required to commit immediately after sending
312         an ack_configure request - it may even ack_configure several times
313         before its next surface commit.
314 
315         A client may send multiple ack_configure requests before committing, but
316         only the last request sent before a commit indicates which configure
317         event the client really is responding to.
318       </description>
319       <arg name="serial" type="uint" summary="the serial from the configure event"/>
320     </request>
321 
322     <request name="destroy" type="destructor">
323       <description summary="destroy the layer_surface">
324         This request destroys the layer surface.
325       </description>
326     </request>
327 
328     <event name="configure">
329       <description summary="suggest a surface change">
330         The configure event asks the client to resize its surface.
331 
332         Clients should arrange their surface for the new states, and then send
333         an ack_configure request with the serial sent in this configure event at
334         some point before committing the new surface.
335 
336         The client is free to dismiss all but the last configure event it
337         received.
338 
339         The width and height arguments specify the size of the window in
340         surface-local coordinates.
341 
342         The size is a hint, in the sense that the client is free to ignore it if
343         it doesn't resize, pick a smaller size (to satisfy aspect ratio or
344         resize in steps of NxM pixels). If the client picks a smaller size and
345         is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the
346         surface will be centered on this axis.
347 
348         If the width or height arguments are zero, it means the client should
349         decide its own window dimension.
350       </description>
351       <arg name="serial" type="uint"/>
352       <arg name="width" type="uint"/>
353       <arg name="height" type="uint"/>
354     </event>
355 
356     <event name="closed">
357       <description summary="surface should be closed">
358         The closed event is sent by the compositor when the surface will no
359         longer be shown. The output may have been destroyed or the user may
360         have asked for it to be removed. Further changes to the surface will be
361         ignored. The client should destroy the resource after receiving this
362         event, and create a new surface if they so choose.
363       </description>
364     </event>
365 
366     <enum name="error">
367       <entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/>
368       <entry name="invalid_size" value="1" summary="size is invalid"/>
369       <entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/>
370       <entry name="invalid_keyboard_interactivity" value="3" summary="keyboard interactivity is invalid"/>
371       <entry name="invalid_exclusive_edge" value="4" summary="exclusive edge is invalid given the surface anchors"/>
372     </enum>
373 
374     <enum name="anchor" bitfield="true">
375       <entry name="top" value="1" summary="the top edge of the anchor rectangle"/>
376       <entry name="bottom" value="2" summary="the bottom edge of the anchor rectangle"/>
377       <entry name="left" value="4" summary="the left edge of the anchor rectangle"/>
378       <entry name="right" value="8" summary="the right edge of the anchor rectangle"/>
379     </enum>
380 
381     <!-- Version 2 additions -->
382 
383     <request name="set_layer" since="2">
384       <description summary="change the layer of the surface">
385         Change the layer that the surface is rendered on.
386 
387         Layer is double-buffered, see wl_surface.commit.
388       </description>
389       <arg name="layer" type="uint" enum="zwlr_layer_shell_v1.layer" summary="layer to move this surface to"/>
390     </request>
391 
392     <!-- Version 5 additions -->
393 
394     <request name="set_exclusive_edge" since="5">
395       <description summary="set the edge the exclusive zone will be applied to">
396         Requests an edge for the exclusive zone to apply. The exclusive
397         edge will be automatically deduced from anchor points when possible,
398         but when the surface is anchored to a corner, it will be necessary
399         to set it explicitly to disambiguate, as it is not possible to deduce
400         which one of the two corner edges should be used.
401 
402         The edge must be one the surface is anchored to, otherwise the
403         invalid_exclusive_edge protocol error will be raised.
404       </description>
405       <arg name="edge" type="uint" enum="anchor"/>
406     </request>
407   </interface>
408 </protocol>