Debian Codegraph @

experimental/xx-zones/xx-zones-v1.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="xx_zones_v1">
3
4 <copyright>
5 Copyright © 2023-2026 Matthias Klumpp
6 Copyright © 2024-2025 Frank Praznik
7 Copyright © 2024 Victoria Brekenfeld
8
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the "Software"),
11 to deal in the Software without restriction, including without limitation
12 the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so, subject to the following conditions:
15
16 The above copyright notice and this permission notice (including the next
17 paragraph) shall be included in all copies or substantial portions of the
18 Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 DEALINGS IN THE SOFTWARE.
27 </copyright>
28
29 <description summary="protocol to manage client-specific zones for explicit window placement">
30 This protocol provides a way for clients to create and add toplevel windows
31 to "zones".
32
33 A zone is an environment with its own coordinate space where clients can
34 add and arrange windows that logically belong and relate to each other.
35 It provides means for, among other things, requesting that windows are
36 placed at specific coordinates within the zone coordinate space.
37 See the description of "xx_zone_v1" for more details.
38
39 This document adheres to RFC 2119 when using words like "must",
40 "should", "may", etc.
41
42 Warning! The protocol described in this file is currently in the testing
43 phase. Backward compatible changes may be added together with the
44 corresponding interface version bump. Backward incompatible changes can
45 only be done by creating a new major version of the extension.
46 </description>
47
48 <interface name="xx_zone_manager_v1" version="1">
49 <description summary="manage zones for clients">
50 The 'xx_zone_manager' interface defines base requests for obtaining and
51 managing zones for a client.
52 </description>
53
54 <request name="destroy" type="destructor">
55 <description summary="Destroy this object">
56 This has no effect other than to destroy the xx_zone_manager object.
57 </description>
58 </request>
59
60 <request name="get_zone_item">
61 <description summary="create a positionable item representing a toplevel">
62 Create a new positionable zone item from an 'xdg_toplevel'.
63 The resulting wrapper object can then be used to position the
64 toplevel window in a zone.
65 </description>
66 <arg name="id" type="new_id" interface="xx_zone_item_v1"/>
67 <arg name="toplevel" type="object" interface="xdg_toplevel" summary="the toplevel window"/>
68 </request>
69
70 <request name="get_zone">
71 <description summary="join a zone or request a new one">
72 Create a new zone. While the zone object exists, the compositor
73 must consider it "used" and keep track of it.
74
75 A zone is represented by a string 'handle'.
76
77 The compositor must keep zone handles valid while any client is
78 referencing the corresponding zone.
79 The compositor may always give a client the same zone for a given
80 output, and remember its position and size for the client, but
81 clients should not rely on this behavior.
82
83 A client can request a zone to be placed on a specific
84 output by passing a wl_output as 'output'. If a valid output
85 is set, the compositor should place the zone on that output.
86 If NULL is passed, the compositor decides the output.
87
88 The compositor should provide the biggest reasonable zone space
89 for the client, governed by its own policy.
90
91 If the compositor wants to deny zone creation (e.g. on a specific
92 output), the returned zone must be "invalid". A zone is invalid
93 if it has a negative size, in which case the client is forbidden
94 to place items in it.
95 </description>
96 <arg name="id" type="new_id" interface="xx_zone_v1"/>
97 <arg name="output" type="object" interface="wl_output"
98 summary="the preferred output to place the zone on, or NULL"
99 allow-null="true"/>
100 </request>
101
102 <request name="get_zone_from_handle">
103 <description summary="join a zone via its handle">
104 Create a new zone object using the zone's handle.
105 For the returned zone, the same rules as described in
106 'get_zone' apply.
107
108 This request returns a reference to an existing or remembered zone
109 that is represented by 'handle'.
110 The zone may potentially have been created by a different client.
111
112 This allows cooperating clients to share the same coordinate space.
113
114 If the zone handle was invalid or unknown, a new zone must
115 be created and returned instead, following the rules outlined
116 in 'get_zone' and assuming no output preference.
117
118 Every new zone object created by this request emits its initial event
119 sequence, including the 'handle' event, which must return a different
120 handle from the one passed to this request in case the existing zone
121 could not be joined.
122 </description>
123 <arg name="id" type="new_id" interface="xx_zone_v1"/>
124 <arg name="handle" type="string" summary="the handle of a zone"/>
125 </request>
126 </interface>
127
128 <interface name="xx_zone_item_v1" version="1">
129 <description summary="opaque surface object that can be positioned in a zone">
130 The zone item object is an opaque descriptor for a positionable
131 element, such as a toplevel window.
132 It currently can only be created from an 'xdg_toplevel' via the
133 'get_zone_item' request on a 'xx_zone_manager'.
134
135 The lifetime of a zone item is tied to its referenced item (usually
136 a toplevel).
137 When the reference is destroyed, the compositor must send a 'closed'
138 event and the zone item becomes inert.
139 </description>
140
141 <request name="destroy" type="destructor">
142 <description summary="delete this object">
143 Destroys the zone item. This request may be sent at any time by the
144 client.
145 By destroying the object, the respective item surface remains at its
146 last position, but its association with its zone is lost.
147 This will also cause it to lose any other attached state described by
148 this protocol.
149
150 If the item was associated with a zone when this request is sent,
151 the compositor must emit 'item_left' on the respective zone, unless
152 it had already been emitted before a 'closed' event.
153 </description>
154 </request>
155
156 <event name="frame_extents">
157 <description summary="the extents of the frame bordering the item">
158 The 'frame_extents' event describes the current extents of the frame
159 bordering the item's content area.
160
161 This event is sent immediately after the item joins a zone, or if
162 the item frame extents have been changed by other means (e.g. toggled
163 by a client request, or compositor involvement). The dimensions are in
164 the same coordinate space as the item's zone (the surface coordinate
165 space).
166
167 This event must be followed by a 'position' event, even if the item's
168 coordinates did not change as a result of the frame extents changing.
169
170 If the item has no associated frame, the event should still be sent,
171 but extents must be set to zero.
172
173 This event can only be emitted if the item is currently associated
174 with a zone.
175 </description>
176 <arg name="top" type="int" summary="current height of the frame bordering the top of the item"/>
177 <arg name="bottom" type="int" summary="current height of the frame bordering the bottom of the item"/>
178 <arg name="left" type="int" summary="current width of the frame bordering the left of the item"/>
179 <arg name="right" type="int" summary="current width of the frame bordering the right of the item"/>
180 </event>
181
182 <request name="set_position">
183 <description summary="set a preferred item surface position">
184 Request a preferred position (x, y) for the specified item
185 surface to be placed at, relative to its associated zone.
186 This state is double-buffered and is applied on the next
187 wl_surface.commit of the surface represented by 'item'.
188
189 X and Y coordinates are relative to the zone this item is associated
190 with, and must not be larger than the dimensions set by the zone size.
191 They may be smaller than zero, if the item's top-left edge is to be
192 placed beyond the zone's top-left sides, but clients should expect the
193 compositor to more aggressively sanitize the coordinate values in that
194 case.
195 If a coordinate exceeds the zone's maximum bounds, the compositor must
196 sanitize it to more appropriate values (e.g. by clamping the values to
197 the maximum size).
198 For infinite zones, the client may pick any coordinate.
199
200 Compositors implementing this protocol should try to place an item
201 at the requested coordinates relative to the item's zone, unless doing
202 so is not allowed by compositor policy (because e.g. the user has set
203 custom rules for the surface represented by the respective item, the
204 surface overlaps with a protected shell component, session management
205 has loaded previous surface positions or the placement request would
206 send the item out of bounds).
207
208 Clients should be aware that their placement preferences might not
209 always be followed and must be prepared to handle the case where the
210 item is placed at a different position by the compositor.
211
212 Once an item has been mapped, a change to its preferred placement can
213 still be requested and should be applied, but must not be followed
214 by the compositor while the user is interacting with the affected item
215 surface (e.g. clicking &amp; dragging within the window, or resizing it).
216
217 After a call to this request, a 'position' event must be emitted with the
218 item's new actual position.
219 If the current item has no zone associated with it, a 'position_failed'
220 event must be emitted.
221 If the compositor did not move the item at all, not even with sanitized
222 values, a 'position_failed' event must be emitted as well.
223 </description>
224 <arg name="x" type="int" summary="x position relative to zone"/>
225 <arg name="y" type="int" summary="y position relative to zone"/>
226 </request>
227
228 <event name="position">
229 <description summary="notify about the position of an item">
230 This event notifies the client of the current position (x, y) of
231 the item relative to its zone.
232 Coordinates are relative to the zone this item belongs to, and only
233 valid within it.
234 Negative coordinates are possible, if the user has moved an item
235 surface beyond the zone's top-left boundary.
236
237 This event is sent in response to a 'set_position' request,
238 or if the item position has been changed by other means
239 (e.g. user interaction or compositor involvement).
240
241 This event can only be emitted if the item is currently associated
242 with a zone.
243 </description>
244 <arg name="x" type="int" summary="current x position relative to zone"/>
245 <arg name="y" type="int" summary="current y position relative to zone"/>
246 </event>
247
248 <event name="position_failed">
249 <description summary="a set_position request has failed">
250 The compositor was unable to set the position of this item entirely,
251 and could not even find sanitized coordinates to place the item at
252 instead.
253
254 This event will also be emitted if 'set_position' was called while the
255 item had no zone associated with it.
256 </description>
257 </event>
258
259 <event name="closed">
260 <description summary="the underlying surface has been destroyed">
261 This event indicates that the surface wrapped by this
262 zone item has been destroyed.
263
264 The 'xx_zone_item_v1' object becomes inert and the client should
265 destroy it. Any requests made on an inert zone item must be silently
266 ignored by the compositor, and no further events will be sent for this
267 item.
268
269 If the item was associated with a zone when this event is sent,
270 the compositor must also emit 'item_left' on the respective zone
271 before sending this event.
272 </description>
273 </event>
274 </interface>
275
276 <interface name="xx_zone_v1" version="1">
277 <description summary="area for a client in which it can set window positioning preferences">
278 An 'xx_zone' describes a display area provided by the compositor in
279 which a client can place windows and move them around.
280
281 A zone's area could, for example, correspond to the space usable for
282 placing windows on a specific output (space without panels or other
283 restricted elements) or it could be an area of the output the compositor
284 has specifically chosen for a client to place its surfaces in.
285
286 Clients should make no assumptions about how a zone is presented to the
287 user (e.g. compositors may visually distinguish what makes up a zone).
288
289 Items are added to a zone as 'xx_zone_item' objects.
290
291 All item surface position coordinates (x, y) are relative to the selected
292 zone.
293 They are using the 'size' of the respective zone as coordinate system,
294 with (0, 0) being in the top left corner.
295
296 If a zone item is moved out of the top/left boundaries of the zone by
297 user interaction, its coordinates must become negative, relative to the
298 zone's top-left coordinate origin. A client may position an item at negative
299 coordinates.
300
301 The compositor must ensure that any item positioned by the client is
302 visible and accessible to the user, and is not moved into invisible space
303 outside of a zone.
304 Positioning requests may be rejected or altered by the compositor, depending
305 on its policy.
306
307 The absolute position of the zone within the compositor's coordinate space
308 is opaque to the client and the compositor may move the entire zone without
309 the client noticing it. A zone may also be arbitrarily resized, in which
310 case the respective 'size' event must be emitted again to notify the client.
311
312 A zone is always tied to an output and does not extend beyond it.
313
314 A zone may be "invalid". An invalid zone is created with a negative
315 'size' and must not be used for item arrangement.
316
317 Upon creation the compositor must emit 'size' and 'handle' events for the
318 newly created 'xx_zone', followed by 'done'.
319 </description>
320
321 <request name="destroy" type="destructor">
322 <description summary="destroy the xx_zone object">
323 Using this request a client can tell the compositor that it is not
324 going to use the 'xx_zone' object anymore.
325 The zone itself must only be destroyed if no other client
326 is currently referencing it, so this request may only destroy the
327 object reference owned by the client.
328 </description>
329 </request>
330
331 <event name="size">
332 <description summary="size of the zone">
333 The 'size' event describes the size of this zone.
334
335 It is a rectangle with its origin in the top-left corner, using
336 the surface coordinate space (device pixels divided by the scaling
337 factor of the output this zone is attached to).
338
339 If a width or height value is zero, the zone is infinite
340 in that direction.
341
342 If the width and height values are negative, the zone is considered
343 "invalid" and must not be used.
344 A size event declaring the zone invalid may only be emitted immediately
345 after the zone was created.
346 A zone must not become invalid at a later time by sending a negative
347 'size' after the zone has been established.
348
349 The 'size' event is sent immediately after creating an 'xx_zone_v1',
350 and whenever the size of the zone changes. A zone size can change at
351 any time, for any reason, for example due to output size or scaling
352 changes, or by compositor policy.
353
354 Upon subsequent emissions of 'size' after 'xx_zone' has already
355 been created, the 'done' event does not have to be sent again.
356 </description>
357 <arg name="width" type="int"
358 summary="zone width in logical pixels"/>
359 <arg name="height" type="int"
360 summary="zone height in logical pixels"/>
361 </event>
362
363 <event name="handle">
364 <description summary="the zone handle">
365 The handle event provides the unique handle of this zone.
366 The handle may be shared with any client, which then can use it to
367 join this client's zone by calling
368 'xx_zone_manager.get_zone_from_handle'.
369
370 This event must only be emitted once after the zone was created.
371 If this zone is invalid, the handle must be an empty string.
372 </description>
373 <arg name="handle" type="string" summary="the exported zone handle"/>
374 </event>
375
376 <event name="done">
377 <description summary="all information about the zone has been sent">
378 This event is sent after all other properties (size, handle) of an
379 'xx_zone' have been sent.
380
381 This allows changes to the xx_zone properties to be seen as
382 atomic, even if they happen via multiple events.
383 </description>
384 </event>
385
386 <enum name="error">
387 <entry name="invalid" summary="an invalid value has been submitted"
388 value="0"/>
389 </enum>
390
391 <request name="add_item">
392 <description summary="associate an item with this zone">
393 Make 'item' a member of this zone.
394 This state is double-buffered and is applied on the next
395 'wl_surface.commit' of the surface represented by 'item'.
396
397 This request associates an item with this zone.
398 If this request is called on an item that already has a zone
399 association with a different zone, the item must leave its old zone
400 (with 'item_left' being emitted on its old zone) and will instead
401 be associated with this zone.
402
403 Upon receiving this request and if the target zone is allowed for 'item',
404 a compositor must emit 'item_entered' to confirm the zone association.
405 It must even emit this event if the item was already associated with this
406 zone before.
407
408 The compositor must move the surface represented by 'item' into the
409 boundary of this zone upon receiving this request and accepting it
410 (either by extending the zone size, or by moving the item surface).
411
412 If the compositor does not allow the item to switch zone associations,
413 and wants it to remain in its previous zone, it must emit
414 'item_blocked' instead.
415 Compositors might want to prevent zone associations if they
416 perform specialized window management (e.g. autotiling) that would
417 make clients moving items between certain zones undesirable.
418
419 Once the 'item' is added to its zone, the compositor must first send
420 a 'frame_extents' event on the item, followed by an initial 'position'
421 event with the item's current position.
422 The compositor must then send 'position' events when the position
423 of the item in its zone is changed, for as long as the item is
424 associated with a zone.
425
426 If the zone is invalid, an 'invalid' error must be raised and the item
427 must not be associated with the invalid zone.
428 If the referenced item is inert (its underlying surface has been
429 destroyed), the request must be silently ignored.
430 </description>
431 <arg name="item" type="object" interface="xx_zone_item_v1" summary="the zone item"/>
432 </request>
433
434 <request name="remove_item">
435 <description summary="disassociate an item from this zone">
436 Remove 'item' as a member of this zone.
437 This state is double-buffered and is applied on the next
438 'wl_surface.commit' of the surface represented by 'item'.
439
440 This request removes the item from this zone explicitly,
441 making the client unable to retrieve coordinates again.
442
443 Upon receiving this request, the compositor should not change the
444 item surface position on screen, and must emit 'item_left' to confirm
445 the item's removal. It must even emit this event if the
446 item was never associated with this zone.
447
448 If the referenced item is inert (its underlying surface has been
449 destroyed), the request must be silently ignored.
450 </description>
451 <arg name="item" type="object" interface="xx_zone_item_v1" summary="the zone item"/>
452 </request>
453
454 <event name="item_blocked">
455 <description summary="an item could not be associated with this zone">
456 This event notifies the client that an item was prevented from
457 joining this zone.
458
459 It is emitted as a response to 'add_item' if the compositor did not
460 allow the item to join this particular zone.
461 </description>
462 <arg name="item" type="object" interface="xx_zone_item_v1" summary="the item that was prevented from joining this zone"/>
463 </event>
464
465 <event name="item_entered">
466 <description summary="notify about an item having joined this zone">
467 This event notifies the client of an item joining this zone.
468
469 It is emitted as a response to 'add_item' or if the compositor
470 automatically had the item surface (re)join an existing zone.
471 </description>
472 <arg name="item" type="object" interface="xx_zone_item_v1" summary="the item that has joined the zone"/>
473 </event>
474
475 <event name="item_left">
476 <description summary="notify about an item having left this zone">
477 This event notifies the client of an item leaving this zone, and
478 therefore the client will no longer receive updated coordinates
479 or frame extents for this item.
480 If the client still wishes to adjust the item surface coordinates, it
481 may associate the item with a zone again by calling 'add_item'.
482
483 This event is emitted for example if the user moved an item surface out
484 of a smaller zone's boundaries, or onto a different screen where the
485 previous zone can not expand to. It is also emitted in response to
486 explicitly removing an item via 'remove_item'.
487 </description>
488 <arg name="item" type="object" interface="xx_zone_item_v1" summary="the item that has left the zone"/>
489 </event>
490
491 </interface>
492
493 </protocol>