1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="wayland">
5 Copyright © 2008-2011 Kristian Høgsberg
6 Copyright © 2010-2011 Intel Corporation
8 Permission to use, copy, modify, distribute, and sell this
9 software and its documentation for any purpose is hereby granted
10 without fee, provided that the above copyright notice appear in
11 all copies and that both that copyright notice and this permission
12 notice appear in supporting documentation, and that the name of
13 the copyright holders not be used in advertising or publicity
14 pertaining to distribution of the software without specific,
15 written prior permission. The copyright holders make no
16 representations about the suitability of this software for any
17 purpose. It is provided "as is" without express or implied
20 THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
21 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
22 FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
23 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
25 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
30 <interface name="wl_display" version="1">
31 <description summary="core global object">
32 The core global object. This is a special singleton object. It
33 is used for internal Wayland protocol features.
37 <description summary="asynchronous roundtrip">
38 The sync request asks the server to emit the 'done' event
39 on the provided wl_callback object. Since requests are
40 handled in-order, this can be used as a barrier to ensure all
41 previous requests have been handled.
43 <arg name="callback" type="new_id" interface="wl_callback"/>
46 <request name="get_registry">
47 <description summary="get global registry object">
48 This request creates a registry object that allows the client
49 to list and bind the global objects available from the
52 <arg name="callback" type="new_id" interface="wl_registry"/>
56 <description summary="fatal error event">
57 The error event is sent out when a fatal (non-recoverable)
58 error has occurred. The @object_id argument is the object
59 where the error occurred, most often in response to a request
60 to that object. The @code identifies the error and is defined
61 by the object interface. As such, each interface defines its
62 own set of error codes. The @message is an brief description
63 of the error, for (debugging) convenience.
65 <arg name="object_id" type="object"/>
66 <arg name="code" type="uint"/>
67 <arg name="message" type="string"/>
71 <description summary="global error values">
72 These errors are global and can be emitted in response to any
75 <entry name="invalid_object" value="0"
76 summary="server couldn't find object"/>
77 <entry name="invalid_method" value="1"
78 summary="method doesn't exist on the specified interface"/>
79 <entry name="no_memory" value="2"
80 summary="server is out of memory"/>
83 <event name="delete_id">
84 <description summary="acknowledge object id deletion">
85 This event is used internally by the object ID management
86 logic. When a client deletes an object, the server will send
87 this event to acknowledge that it has seen the delete request.
88 When the client receive this event, it will know that it can
89 safely reuse the object ID
91 <arg name="id" type="uint" />
95 <interface name="wl_registry" version="1">
96 <description summary="global registry object">
97 The global registry object. The server has a number of global
98 objects that are available to all clients. These objects
99 typically represent an actual object in the server (for example,
100 an input device) or they are singleton objects that provides
101 extension functionality.
103 When a client creates a registry object, the registry object
104 will emit a global event for each global currently in the
105 regitry. Globals come and go as a result of device hotplugs,
106 reconfiguration or other events, and the registry will send out
107 @global and @global_remove events to keep the client up to date
108 with the changes. To mark the end of the initial burst of
109 events, the client can use the wl_display.sync request
110 immediately after calling wl_display.get_registry.
112 A client can 'bind' to a global object by using the bind
113 request. This creates a client side handle that lets the object
114 emit events to the client and lets the client invoke requests on
118 <request name="bind">
119 <description summary="bind an object to the display">
120 Binds a new, client-created object to the server using @name as
123 <arg name="name" type="uint" summary="unique number id for object"/>
124 <arg name="id" type="new_id"/>
127 <event name="global">
128 <description summary="announce global object">
129 Notify the client of global objects.
131 <arg name="name" type="uint"/>
132 <arg name="interface" type="string"/>
133 <arg name="version" type="uint"/>
136 <event name="global_remove">
137 <description summary="announce removal of global object">
138 Notify the client of removed global objects. This event
139 notifies the client that the global identifies by @name is no
140 longer available. If the client bound to the global using the
141 'bind' request, the client should now destroy that object.
142 The object remains valid and requests to the object will be
143 ignored until the client destroys it, to avoid races between
144 the global going away and a client sending a request to it.
146 <arg name="name" type="uint"/>
150 <interface name="wl_callback" version="1">
152 <arg name="serial" type="uint"/>
156 <interface name="wl_compositor" version="1">
157 <description summary="the compositor singleton">
158 A compositor. This object is a singleton global. The
159 compositor is in charge of combining the contents of multiple
160 surfaces into one displayable output.
163 <request name="create_surface">
164 <description summary="create new surface">
165 Ask the compositor to create a new surface.
167 <arg name="id" type="new_id" interface="wl_surface"/>
170 <request name="create_region">
171 <description summary="create new region">
172 Ask the compositor to create a new region.
174 <arg name="id" type="new_id" interface="wl_region"/>
178 <interface name="wl_shm_pool" version="1">
179 <description summary="a shared memory pool">
180 The wl_shm_pool object encapsulates a piece of memory shared
181 between the compositor and client. Through the wl_shm_pool
182 object, the client can allocate shared memory wl_buffer objects.
183 The objects will share the same underlying mapped memory.
184 Reusing the mapped memory avoids the setup/teardown overhead and
185 is useful when interactively resizing a surface or for many
189 <request name="create_buffer">
190 <description summary="create wl_buffer from pool">
191 Create a wl_buffer from the pool. The buffer is created a
192 offset bytes into the pool and has width and height as
193 specified. The stride arguments specifies the number of bytes
194 from beginning of one row to the beginning of the next. The
195 format is the pixel format of the buffer and must be one of
196 those advertised through the wl_shm.format event.
198 A buffer will keep a reference to the pool it was created from
199 so it is valid to destroy the pool immediately after creating
203 <arg name="id" type="new_id" interface="wl_buffer"/>
204 <arg name="offset" type="int"/>
205 <arg name="width" type="int"/>
206 <arg name="height" type="int"/>
207 <arg name="stride" type="int"/>
208 <arg name="format" type="uint"/>
211 <request name="destroy" type="destructor">
212 <description summary="destroy the pool">
217 <request name="resize">
218 <description summary="change the size of the pool mapping">
219 This request will cause the server to remap the backing memory
220 for the pool from the fd passed when the pool was creating but
224 <arg name="size" type="int"/>
228 <interface name="wl_shm" version="1">
229 <description summary="shared memory support">
230 Support for shared memory buffers.
234 <entry name="invalid_format" value="0"/>
235 <entry name="invalid_stride" value="1"/>
236 <entry name="invalid_fd" value="2"/>
240 <entry name="argb8888" value="0"/>
241 <entry name="xrgb8888" value="1"/>
244 <request name="create_pool">
245 <description summary="create a shm pool">
246 This creates wl_shm_pool object, which can be used to create
247 shared memory based wl_buffer objects. The server will mmap
248 size bytes of the passed fd, to use as backing memory for then
252 <arg name="id" type="new_id" interface="wl_shm_pool"/>
253 <arg name="fd" type="fd"/>
254 <arg name="size" type="int"/>
257 <event name="format">
258 <arg name="format" type="uint"/>
262 <interface name="wl_buffer" version="1">
263 <description summary="content for a wl_surface">
264 A buffer provides the content for a wl_surface. Buffers are
265 created through factory interfaces such as wl_drm, wl_shm or
266 similar. It has a width and a height and can be attached to a
267 wl_surface, but the mechanism by which a client provides and
268 updates the contents is defined by the buffer factory interface.
271 <request name="destroy" type="destructor">
272 <description summary="destroy a buffer">
273 Destroy a buffer. If and how you need to release the backing
274 storage is defined by the buffer factory interface.
276 For possible side-effects to a surface, see wl_surface.attach.
280 <event name="release">
281 <description summary="compositor releases buffer">
282 Sent when this wl_buffer is no longer used by the compositor.
283 The client is now free to re-use or destroy this buffer and its
286 If a client receives a release event before the frame callback
287 requested in the same wl_surface.commit that attaches this
288 wl_buffer to a surface, then the client is immediately free to
289 re-use the buffer and its backing storage, and does not need a
290 second buffer for the next surface content update. Typically
291 this is possible, when the compositor maintains a copy of the
292 wl_surface contents, e.g. as a GL texture. This is an important
293 optimization for GL(ES) compositors with wl_shm clients.
299 <interface name="wl_data_offer" version="1">
300 <description summary="offer to transfer data">
301 A wl_data_offer represents a piece of data offered for transfer
302 by another client (the source client). It is used by the
303 copy-and-paste and drag-and-drop mechanisms. The offer
304 describes the different mime types that the data can be
305 converted to and provides the mechanism for transferring the
306 data directly from the source client.
309 <request name="accept">
310 <description summary="accept one of the offered mime-types">
311 Indicate that the client can accept the given mime-type, or
312 NULL for not accepted. Use for feedback during drag and drop.
315 <arg name="serial" type="uint"/>
316 <arg name="type" type="string" allow-null="true"/>
319 <request name="receive">
320 <description summary="request that the data is transferred">
321 To transfer the offered data, the client issues this request
322 and indicates the mime-type it wants to receive. The transfer
323 happens through the passed fd (typically a pipe(7) file
324 descriptor). The source client writes the data in the
325 mime-type representation requested and then closes the fd.
326 The receiving client reads from the read end of the pipe until
327 EOF and the closes its end, at which point the transfer is
330 <arg name="mime_type" type="string"/>
331 <arg name="fd" type="fd"/>
334 <request name="destroy" type="destructor"/>
337 <description summary="advertise offered mime-type">
338 Sent immediately after creating the wl_data_offer object. One
339 event per offered mime type.
342 <arg name="type" type="string"/>
346 <interface name="wl_data_source" version="1">
347 <description summary="offer to transfer data">
348 The wl_data_source object is the source side of a wl_data_offer.
349 It is created by the source client in a data transfer and
350 provides a way to describe the offered data and a way to respond
351 to requests to transfer the data.
354 <request name="offer">
355 <description summary="add an offered mime type">
356 This request adds a mime-type to the set of mime-types
357 advertised to targets. Can be called several times to offer
360 <arg name="type" type="string"/>
363 <request name="destroy" type="destructor">
364 <description summary="destroy the data source">
365 Destroy the data source.
369 <event name="target">
370 <description summary="a target accepts an offered mime-type">
371 Sent when a target accepts pointer_focus or motion events. If
372 a target does not accept any of the offered types, type is NULL.
375 <arg name="mime_type" type="string" allow-null="true"/>
379 <description summary="send the data">
380 Request for data from another client. Send the data as the
381 specified mime-type over the passed fd, then close the fd.
384 <arg name="mime_type" type="string"/>
385 <arg name="fd" type="fd"/>
388 <event name="cancelled">
389 <description summary="selection was cancelled">
390 This data source has been replaced by another data source.
391 The client should clean up and destroy this data source.
397 <interface name="wl_data_device" version="1">
398 <request name="start_drag">
399 <description summary="start drag and drop operation">
400 This request asks the compositor to start a drag and drop
401 operation on behalf of the client.
403 The source argument is the data source that provides the data
404 for the eventual data transfer. If source is NULL, enter, leave
405 and motion events are sent only to the client that initiated the
406 drag and the client is expected to handle the data passing
409 The origin surface is the surface where the drag originates and
410 the client must have an active implicit grab that matches the
413 The icon surface is an optional (can be nil) surface that
414 provides an icon to be moved around with the cursor. Initially,
415 the top-left corner of the icon surface is placed at the cursor
416 hotspot, but subsequent wl_surface.attach request can move the
417 relative position. Attach requests must be confirmed with
418 wl_surface.commit as usual.
420 The current and pending input regions of the icon wl_surface are
421 cleared, and wl_surface.set_input_region is ignored until the
422 wl_surface is no longer used as the icon surface. When the use
423 as an icon ends, the the current and pending input regions
424 become undefined, and the wl_surface is unmapped.
426 <arg name="source" type="object" interface="wl_data_source" allow-null="true"/>
427 <arg name="origin" type="object" interface="wl_surface"/>
428 <arg name="icon" type="object" interface="wl_surface" allow-null="true"/>
429 <arg name="serial" type="uint"/>
432 <request name="set_selection">
433 <arg name="source" type="object" interface="wl_data_source" allow-null="true"/>
434 <arg name="serial" type="uint"/>
437 <event name="data_offer">
438 <description summary="introduce a new wl_data_offer">
439 The data_offer event introduces a new wl_data_offer object,
440 which will subsequently be used in either the
441 data_device.enter event (for drag and drop) or the
442 data_device.selection event (for selections). Immediately
443 following the data_device_data_offer event, the new data_offer
444 object will send out data_offer.offer events to describe the
445 mime-types it offers.
448 <arg name="id" type="new_id" interface="wl_data_offer"/>
452 <description summary="initiate drag and drop session">
453 This event is sent when an active drag-and-drop pointer enters
454 a surface owned by the client. The position of the pointer at
455 enter time is provided by the @x an @y arguments, in surface
459 <arg name="serial" type="uint"/>
460 <arg name="surface" type="object" interface="wl_surface"/>
461 <arg name="x" type="fixed"/>
462 <arg name="y" type="fixed"/>
463 <arg name="id" type="object" interface="wl_data_offer" allow-null="true"/>
467 <description summary="end drag and drop session">
468 This event is sent when the drag-and-drop pointer leaves the
469 surface and the session ends. The client must destroy the
470 wl_data_offer introduced at enter time at this point.
474 <event name="motion">
475 <description summary="drag and drop session motion">
476 This event is sent when the drag-and-drop pointer moves within
477 the currently focused surface. The new position of the pointer
478 is provided by the @x an @y arguments, in surface local
481 <arg name="time" type="uint"/>
482 <arg name="x" type="fixed"/>
483 <arg name="y" type="fixed"/>
488 <event name="selection">
489 <description summary="advertise new selection">
490 The selection event is sent out to notify the client of a new
491 wl_data_offer for the selection for this device. The
492 data_device.data_offer and the data_offer.offer events are
493 sent out immediately before this event to introduce the data
494 offer object. The selection event is sent to a client
495 immediately before receiving keyboard focus and when a new
496 selection is set while the client has keyboard focus. The
497 data_offer is valid until a new data_offer or NULL is received
498 or until the client loses keyboard focus.
500 <arg name="id" type="object" interface="wl_data_offer" allow-null="true"/>
504 <interface name="wl_data_device_manager" version="1">
505 <request name="create_data_source">
506 <arg name="id" type="new_id" interface="wl_data_source"/>
509 <request name="get_data_device">
510 <arg name="id" type="new_id" interface="wl_data_device"/>
511 <arg name="seat" type="object" interface="wl_seat"/>
515 <interface name="wl_shell" version="1">
516 <request name="get_shell_surface">
517 <arg name="id" type="new_id" interface="wl_shell_surface"/>
518 <arg name="surface" type="object" interface="wl_surface"/>
522 <interface name="wl_shell_surface" version="1">
524 <description summary="desktop style meta data interface">
525 An interface implemented by a wl_surface. On server side the
526 object is automatically destroyed when the related wl_surface is
527 destroyed. On client side, wl_shell_surface_destroy() must be
528 called before destroying the wl_surface object.
531 <request name="pong">
532 <description summary="respond to a ping event">
533 A client must respond to a ping event with a pong request or
534 the client may be deemed unresponsive.
536 <arg name="serial" type="uint"/>
539 <request name="move">
540 <arg name="seat" type="object" interface="wl_seat"/>
541 <arg name="serial" type="uint"/>
545 <entry name="none" value="0"/>
546 <entry name="top" value="1"/>
547 <entry name="bottom" value="2"/>
548 <entry name="left" value="4"/>
549 <entry name="top_left" value="5"/>
550 <entry name="bottom_left" value="6"/>
551 <entry name="right" value="8"/>
552 <entry name="top_right" value="9"/>
553 <entry name="bottom_right" value="10"/>
556 <request name="resize">
557 <arg name="seat" type="object" interface="wl_seat"/>
558 <arg name="serial" type="uint"/>
559 <arg name="edges" type="uint"/>
562 <request name="set_toplevel">
563 <description summary="make the surface a top level surface">
564 Make the surface a toplevel window.
568 <enum name="transient">
569 <entry name="inactive" value="0x1" summary="do not set keyboard focus"/>
572 <request name="set_transient">
573 <description summary="make the surface a transient surface">
574 Map the surface relative to an existing surface. The x and y
575 arguments specify the locations of the upper left corner of
576 the surface relative to the upper left corner of the parent
577 surface. The flags argument controls overflow/clipping
578 behaviour when the surface would intersect a screen edge,
579 panel or such. And possibly whether the offset only
580 determines the initial position or if the surface is locked to
581 that relative position during moves.
584 <arg name="parent" type="object" interface="wl_surface"/>
585 <arg name="x" type="int"/>
586 <arg name="y" type="int"/>
587 <arg name="flags" type="uint"/>
590 <request name="set_fullscreen">
591 <description summary="make the surface a fullscreen surface">
592 Map the surface as a fullscreen surface. If an output parameter is
593 given then the surface will be made fullscreen on that output. If the
594 client does not specify the output then the compositor will apply its
595 policy - usually choosing the output on which the surface has the
596 biggest surface area.
598 The client may specify a method to resolve a size conflict between the
599 output size and the surface size - this is provided through the
600 fullscreen_method parameter.
602 The framerate parameter is used only when the fullscreen_method is set
603 to "driver", to indicate the preferred framerate. framerate=0 indicates
604 that the app does not care about framerate. The framerate is
605 specified in mHz, that is framerate of 60000 is 60Hz.
607 The compositor must reply to this request with a configure event with
608 the dimensions for the output on which the surface will be made fullscreen.
610 <arg name="method" type="uint"/>
611 <arg name="framerate" type="uint"/>
612 <arg name="output" type="object" interface="wl_output" allow-null="true"/>
615 <enum name="fullscreen_method">
616 <description summary="different method to set the surface fullscreen">
617 Hints to indicate compositor how to deal with a conflict between the
618 dimensions for the surface and the dimensions of the output. As a hint
619 the compositor is free to ignore this parameter.
621 "default" The client has no preference on fullscreen behavior,
622 policies are determined by compositor.
624 "scale" The client prefers scaling by the compositor. Scaling would
625 always preserve surface's aspect ratio with surface centered on the
628 "driver" The client wants to switch video mode to the smallest mode
629 that can fit the client buffer. If the sizes do not match the
630 compositor must add black borders.
632 "fill" The surface is centered on the output on the screen with no
633 scaling. If the surface is of insufficient size the compositor must
636 <entry name="default" value="0"/>
637 <entry name="scale" value="1"/>
638 <entry name="driver" value="2"/>
639 <entry name="fill" value="3"/>
642 <request name="set_popup">
643 <description summary="make the surface a popup surface">
644 Popup surfaces. Will switch an implicit grab into
645 owner-events mode, and grab will continue after the implicit
646 grab ends (button released). Once the implicit grab is over,
647 the popup grab continues until the window is destroyed or a
648 mouse button is pressed in any other clients window. A click
649 in any of the clients surfaces is reported as normal, however,
650 clicks in other clients surfaces will be discarded and trigger
653 TODO: Grab keyboard too, maybe just terminate on any click
654 inside or outside the surface?
657 <arg name="seat" type="object" interface="wl_seat"/>
658 <arg name="serial" type="uint"/>
659 <arg name="parent" type="object" interface="wl_surface"/>
660 <arg name="x" type="int"/>
661 <arg name="y" type="int"/>
662 <arg name="flags" type="uint"/>
665 <request name="set_maximized">
666 <description summary="make the surface a maximized surface">
667 A request from the client to notify the compositor the maximized
668 operation. The compositor will reply with a configure event telling
669 the expected new surface size. The operation is completed on the
670 next buffer attach to this surface.
671 A maximized client will fill the fullscreen of the output it is bound
672 to, except the panel area. This is the main difference between
673 a maximized shell surface and a fullscreen shell surface.
675 <arg name="output" type="object" interface="wl_output" allow-null="true"/>
678 <request name="set_title">
679 <description summary="set surface title">
681 <arg name="title" type="string"/>
684 <request name="set_class">
685 <description summary="set surface class">
686 The surface class identifies the general class of applications
687 to which the surface belongs. The class is the file name of
688 the applications .desktop file (absolute path if non-standard
691 <arg name="class_" type="string"/>
695 <description summary="ping client">
696 Ping a client to check if it is receiving events and sending
697 requests. A client is expected to reply with a pong request.
699 <arg name="serial" type="uint"/>
702 <event name="configure">
703 <description summary="suggest resize">
704 The configure event asks the client to resize its surface.
705 The size is a hint, in the sense that the client is free to
706 ignore it if it doesn't resize, pick a smaller size (to
707 satisfy aspect ratio or resize in steps of NxM pixels). The
708 client is free to dismiss all but the last configure event it
712 <arg name="edges" type="uint"/>
713 <arg name="width" type="int"/>
714 <arg name="height" type="int"/>
717 <event name="popup_done">
718 <description summary="popup interaction is done">
719 The popup_done event is sent out when a popup grab is broken,
720 that is, when the users clicks a surface that doesn't belong
721 to the client owning the popup surface.
726 <interface name="wl_surface" version="1">
727 <description summary="an onscreen surface">
728 A surface. This is an image that is displayed on the screen.
729 It has a location, size and pixel contents.
732 <request name="destroy" type="destructor">
733 <description summary="delete surface">
734 Deletes the surface and invalidates its object id.
738 <request name="attach">
739 <description summary="set the surface contents">
740 Set the contents of a buffer into this surface. The x and y
741 arguments specify the location of the new pending buffer's upper
742 left corner, relative to the current buffer's upper left corner. In
743 other words, the x and y, and the width and height of the wl_buffer
744 together define in which directions the surface's size changes.
746 Surface contents are double-buffered state, see wl_surface.commit.
748 The initial surface contents are void; there is no content.
749 wl_surface.attach assigns the given wl_buffer as the pending wl_buffer.
750 wl_surface.commit applies the pending wl_buffer as the new
751 surface contents, and the size of the surface becomes the size of
752 the wl_buffer. The wl_buffer is also kept as pending, until
753 changed by wl_surface.attach or the wl_buffer is destroyed.
755 Committing a pending wl_buffer allows the compositor to read the
756 pixels in the wl_buffer. The compositor may access the pixels at any
757 time after the wl_surface.commit request. When the compositor will
758 not access the pixels anymore, it will send the wl_buffer.release
759 event. Only after receiving wl_buffer.release, the client may re-use
760 the wl_buffer. A wl_buffer, that has been attached and then replaced
761 by another attach instead of committed, will not receive a release
762 event, and is not used by the compositor.
764 Destroying the wl_buffer after wl_buffer.release does not change the
765 surface contents, even if the wl_buffer is still pending for the
766 next commit. In such case, the next commit does not change the
767 surface contents. However, if the client destroys the wl_buffer
768 before receiving wl_buffer.release, the surface contents become
769 undefined immediately.
771 Only if wl_surface.attach is sent with a nil wl_buffer, the
772 following wl_surface.commit will remove the surface content.
775 <arg name="buffer" type="object" interface="wl_buffer" allow-null="true"/>
776 <arg name="x" type="int"/>
777 <arg name="y" type="int"/>
780 <request name="damage">
781 <description summary="mark part of the surface damaged">
782 This request is used to describe the regions where the pending
783 buffer (or if pending buffer is none, the current buffer as updated
784 in-place) on the next wl_surface.commit will be different from the
785 current buffer, and needs to be repainted. The pending buffer can be
786 set by wl_surface.attach. The compositor ignores the parts of the
787 damage that fall outside of the surface.
789 Damage is double-buffered state, see wl_surface.commit.
791 The initial value for pending damage is empty: no damage.
792 wl_surface.damage adds pending damage: the new pending damage is the
793 union of old pending damage and the given rectangle.
794 wl_surface.commit assigns pending damage as the current damage, and
795 clears pending damage. The server will clear the current damage as
796 it repaints the surface.
799 <arg name="x" type="int"/>
800 <arg name="y" type="int"/>
801 <arg name="width" type="int"/>
802 <arg name="height" type="int"/>
805 <request name="frame">
806 <description summary="request repaint feedback">
807 Request notification when the next frame is displayed. Useful
808 for throttling redrawing operations, and driving animations.
809 The frame request will take effect on the next wl_surface.commit.
810 The notification will only be posted for one frame unless
813 A server should avoid signalling the frame callbacks if the
814 surface is not visible in any way, e.g. the surface is off-screen,
815 or completely obscured by other opaque surfaces.
817 A client can request a frame callback even without an attach,
818 damage, or any other state changes. wl_surface.commit triggers a
819 display update, so the callback event will arrive after the next
820 output refresh where the surface is visible.
823 <arg name="callback" type="new_id" interface="wl_callback"/>
826 <request name="set_opaque_region">
827 <description summary="set opaque region">
828 This request sets the region of the surface that contains
829 opaque content. The opaque region is an optimization hint for
830 the compositor that lets it optimize out redrawing of content
831 behind opaque regions. Setting an opaque region is not
832 required for correct behaviour, but marking transparent
833 content as opaque will result in repaint artifacts.
834 The compositor ignores the parts of the opaque region that fall
835 outside of the surface.
837 Opaque region is double-buffered state, see wl_surface.commit.
839 wl_surface.set_opaque_region changes the pending opaque region.
840 wl_surface.commit copies the pending region to the current region.
841 Otherwise the pending and current regions are never changed.
843 The initial value for opaque region is empty. Setting the pending
844 opaque region has copy semantics, and the wl_region object can be
845 destroyed immediately. A nil wl_region causes the pending opaque
846 region to be set to empty.
849 <arg name="region" type="object" interface="wl_region" allow-null="true"/>
852 <request name="set_input_region">
853 <description summary="set input region">
854 This request sets the region of the surface that can receive
855 pointer and touch events. Input events happening outside of
856 this region will try the next surface in the server surface
857 stack. The compositor ignores the parts of the input region that
858 fall outside of the surface.
860 Input region is double-buffered state, see wl_surface.commit.
862 wl_surface.set_input_region changes the pending input region.
863 wl_surface.commit copies the pending region to the current region.
864 Otherwise the pending and current regions are never changed,
865 except cursor and icon surfaces are special cases, see
866 wl_pointer.set_cursor and wl_data_device.start_drag.
868 The initial value for input region is infinite. That means the whole
869 surface will accept input. Setting the pending input region has copy
870 semantics, and the wl_region object can be destroyed immediately. A
871 nil wl_region causes the input region to be set to infinite.
874 <arg name="region" type="object" interface="wl_region" allow-null="true"/>
877 <request name="commit">
878 <description summary="commit pending surface state">
879 Surface state (input, opaque, and damage regions, attached buffers,
880 etc.) is double-buffered. Protocol requests modify the pending
881 state, as opposed to current state in use by the compositor. Commit
882 request atomically applies all pending state, replacing the current
883 state. After commit, the new pending state is as documented for each
886 On commit, a pending wl_buffer is applied first, all other state
887 second. This means that all coordinates in double-buffered state are
888 relative to the new wl_buffer coming into use, except for
889 wl_surface.attach itself. If the pending wl_buffer is none, the
890 coordinates are relative to the current surface contents.
892 All requests that need a commit to become effective are documented
893 to affect double-buffered state.
895 Other interfaces may add further double-buffered surface state.
900 <description summary="surface enters an output">
901 This is emitted whenever a surface's creation, movement, or resizing
902 results in some part of it being within the scanout region of an
905 <arg name="output" type="object" interface="wl_output"/>
909 <description summary="surface leaves an output">
910 This is emitted whenever a surface's creation, movement, or resizing
911 results in it no longer having any part of it within the scanout region
914 <arg name="output" type="object" interface="wl_output"/>
918 <interface name="wl_seat" version="1">
919 <description summary="seat">
920 A group of keyboards, pointer (mice, for example) and touch
921 devices . This object is published as a global during start up,
922 or when such a device is hot plugged. A seat typically has a
923 pointer and maintains a keyboard_focus and a pointer_focus.
926 <enum name="capability">
927 <description summary="seat capability bitmask">
928 This is a bitmask of capabilities this seat has; if a member is
929 set, then it is present on the seat.
931 <entry name="pointer" value="1" summary="wl_pointer"/>
932 <entry name="keyboard" value="2" summary="wl_keyboard"/>
933 <entry name="touch" value="4" summary="wl_touch"/>
937 <event name="capabilities">
938 <description summary="seat capabilities changed">
939 This is emitted whenever a seat gains or loses the pointer,
940 keyboard or touch capabilities. The argument is a wl_seat_caps_mask
941 enum containing the complete set of capabilities this seat has.
943 <arg name="capabilities" type="uint"/>
946 <request name="get_pointer">
947 <description summary="return pointer object">
948 The ID provided will be initialized to the wl_pointer interface
951 <arg name="id" type="new_id" interface="wl_pointer"/>
954 <request name="get_keyboard">
955 <description summary="return pointer object">
956 The ID provided will be initialized to the wl_keyboard interface
959 <arg name="id" type="new_id" interface="wl_keyboard"/>
962 <request name="get_touch">
963 <description summary="return pointer object">
964 The ID provided will be initialized to the wl_touch interface
967 <arg name="id" type="new_id" interface="wl_touch"/>
971 <interface name="wl_pointer" version="1">
972 <request name="set_cursor">
973 <description summary="set the pointer surface">
974 Set the pointer surface, i.e., the surface that contains the
975 pointer image (cursor). This request only takes effect if the pointer
976 focus for this device is one of the requesting client's surfaces
977 or the surface parameter is the current pointer surface. If
978 there was a previous surface set with this request it is
979 replaced. If surface is NULL, the pointer image is hidden.
981 The parameters hotspot_x and hotspot_y define the position of
982 the pointer surface relative to the pointer location. Its
983 top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
984 where (x, y) are the coordinates of the pointer location.
986 On surface.attach requests to the pointer surface, hotspot_x
987 and hotspot_y are decremented by the x and y parameters
988 passed to the request. Attach must be confirmed by
989 wl_surface.commit as usual.
991 The hotspot can also be updated by passing the currently set
992 pointer surface to this request with new values for hotspot_x
995 The current and pending input regions of the wl_surface are
996 cleared, and wl_surface.set_input_region is ignored until the
997 wl_surface is no longer used as the cursor. When the use as a
998 cursor ends, the current and pending input regions become
999 undefined, and the wl_surface is unmapped.
1002 <arg name="serial" type="uint"/>
1003 <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
1004 <arg name="hotspot_x" type="int"/>
1005 <arg name="hotspot_y" type="int"/>
1008 <event name="enter">
1009 <description summary="enter event">
1010 Notification that this seat's pointer is focused on a certain
1011 surface. When an seat's focus enters a surface, the pointer image
1012 is undefined and a client should respond to this event by setting
1013 an appropriate pointer image.
1016 <arg name="serial" type="uint"/>
1017 <arg name="surface" type="object" interface="wl_surface"/>
1018 <arg name="surface_x" type="fixed"/>
1019 <arg name="surface_y" type="fixed"/>
1022 <event name="leave">
1023 <description summary="leave event">
1025 <arg name="serial" type="uint"/>
1026 <arg name="surface" type="object" interface="wl_surface"/>
1029 <event name="motion">
1030 <description summary="pointer motion event">
1031 Notification of pointer location change. The arguments surface_[xy]
1032 are the location relative to the focused surface.
1035 <arg name="time" type="uint"/>
1036 <arg name="surface_x" type="fixed"/>
1037 <arg name="surface_y" type="fixed"/>
1040 <enum name="button_state">
1041 <description summary="physical button state">
1042 Describes the physical state of a button which provoked the button
1045 <entry name="released" value="0" summary="button is not pressed"/>
1046 <entry name="pressed" value="1" summary="button is pressed"/>
1049 <event name="button">
1050 <description summary="pointer button event">
1051 Mouse button click and release notifications. The location
1052 of the click is given by the last motion or pointer_focus event.
1055 <arg name="serial" type="uint"/>
1056 <arg name="time" type="uint"/>
1057 <arg name="button" type="uint"/>
1058 <arg name="state" type="uint"/>
1062 <description summary="axis types"/>
1063 <entry name="vertical_scroll" value="0"/>
1064 <entry name="horizontal_scroll" value="1"/>
1068 <description summary="axis event">
1069 Scroll and other axis notifications.
1071 For scroll events (vertical and horizontal scroll axes), the
1072 value parameter is the length of a vector along the specified
1073 axis in a coordinate space identical to those of motion events,
1074 representing a relative movement along the specified axis.
1076 For devices that support movements non-parallel to axes multiple
1077 axis events will be emitted.
1079 When applicable, for example for touch pads, the server can
1080 choose to emit scroll events where the motion vector is
1081 equivalent to a motion event vector.
1083 When applicable, clients can transform its view relative to the
1087 <arg name="time" type="uint"/>
1088 <arg name="axis" type="uint"/>
1089 <arg name="value" type="fixed"/>
1093 <interface name="wl_keyboard" version="1">
1094 <description summary="keyboard input device">
1097 <enum name="keymap_format">
1098 <description summary="keyboard mapping format">
1099 This enum specifies the format of the keymap provided to the client
1100 with the wl_keyboard::keymap event.
1102 <entry name="xkb_v1" value="1" description="libxkbcommon compatible"/>
1105 <event name="keymap">
1106 <description summary="keyboard mapping">
1107 This event provides a file descriptor to the client which can be
1108 memory-mapped to provide a keyboard mapping description.
1110 <arg name="format" type="uint"/>
1111 <arg name="fd" type="fd"/>
1112 <arg name="size" type="uint"/>
1115 <event name="enter">
1116 <arg name="serial" type="uint"/>
1117 <arg name="surface" type="object" interface="wl_surface"/>
1118 <arg name="keys" type="array"/>
1121 <event name="leave">
1122 <arg name="serial" type="uint"/>
1123 <arg name="surface" type="object" interface="wl_surface"/>
1126 <enum name="key_state">
1127 <description summary="physical key state">
1128 Describes the physical state of a key which provoked the key event.
1130 <entry name="released" value="0" summary="key is not pressed"/>
1131 <entry name="pressed" value="1" summary="key is pressed"/>
1135 <description summary="key event">
1136 A key was pressed or released.
1139 <arg name="serial" type="uint"/>
1140 <arg name="time" type="uint"/>
1141 <arg name="key" type="uint"/>
1142 <arg name="state" type="uint"/>
1145 <event name="modifiers">
1146 <description summary="modifier and group state">
1147 Notifies clients that the modifier and/or group state has
1148 changed, and it should update its local state.
1151 <arg name="serial" type="uint"/>
1152 <arg name="mods_depressed" type="uint"/>
1153 <arg name="mods_latched" type="uint"/>
1154 <arg name="mods_locked" type="uint"/>
1155 <arg name="group" type="uint"/>
1159 <interface name="wl_touch" version="1">
1160 <description summary="touch screen input device">
1164 <arg name="serial" type="uint"/>
1165 <arg name="time" type="uint"/>
1166 <arg name="surface" type="object" interface="wl_surface"/>
1167 <arg name="id" type="int" />
1168 <arg name="x" type="fixed" />
1169 <arg name="y" type="fixed" />
1173 <arg name="serial" type="uint"/>
1174 <arg name="time" type="uint"/>
1175 <arg name="id" type="int" />
1178 <event name="motion">
1179 <arg name="time" type="uint"/>
1180 <arg name="id" type="int" />
1181 <arg name="x" type="fixed" />
1182 <arg name="y" type="fixed" />
1185 <event name="frame">
1186 <description summary="end of touch frame event">
1187 Indicates the end of a contact point list.
1191 <event name="cancel">
1192 <description summary="touch session cancelled">
1193 Sent if the compositor decides the touch stream is a global
1194 gesture. No further events are sent to the clients from that
1201 <interface name="wl_output" version="1">
1202 <description summary="compositor output region">
1203 An output describes part of the compositor geometry. The
1204 compositor work in the 'compositor coordinate system' and an
1205 output corresponds to rectangular area in that space that is
1206 actually visible. This typically corresponds to a monitor that
1207 displays part of the compositor space. This object is published
1208 as global during start up, or when a screen is hot plugged.
1211 <enum name="subpixel">
1212 <entry name="unknown" value="0"/>
1213 <entry name="none" value="1"/>
1214 <entry name="horizontal_rgb" value="2"/>
1215 <entry name="horizontal_bgr" value="3"/>
1216 <entry name="vertical_rgb" value="4"/>
1217 <entry name="vertical_bgr" value="5"/>
1220 <enum name="transform">
1221 <description summary="transform from framebuffer to output">
1222 This describes the transform that a compositor will apply to a
1223 surface to compensate for the rotation or mirroring of an
1226 The flipped values correspond to an initial flip around a
1227 vertical axis followed by rotation.
1229 The purpose is mainly to allow clients render accordingly and
1230 tell the compositor, so that for fullscreen surfaces, the
1231 compositor will still be able to scan out directly from client
1235 <entry name="normal" value="0"/>
1236 <entry name="90" value="1"/>
1237 <entry name="180" value="2"/>
1238 <entry name="270" value="3"/>
1239 <entry name="flipped" value="4"/>
1240 <entry name="flipped_90" value="5"/>
1241 <entry name="flipped_180" value="6"/>
1242 <entry name="flipped_270" value="7"/>
1245 <event name="geometry">
1246 <description summary="properties of the output"/>
1247 <arg name="x" type="int"
1248 summary="x position within the global compositor space"/>
1249 <arg name="y" type="int"
1250 summary="y position within the global compositor space"/>
1251 <arg name="physical_width" type="int"
1252 summary="width in millimeters of the output"/>
1253 <arg name="physical_height" type="int"
1254 summary="height in millimeters of the output"/>
1255 <arg name="subpixel" type="int"
1256 summary="subpixel orientation of the output"/>
1257 <arg name="make" type="string"
1258 summary="textual description of the manufacturer"/>
1259 <arg name="model" type="string"
1260 summary="textual description of the model"/>
1261 <arg name="transform" type="int"
1262 summary="transform that maps framebuffer to output"/>
1266 <description summary="values for the flags bitfield in the mode event"/>
1267 <entry name="current" value="0x1"
1268 summary="indicates this is the current mode"/>
1269 <entry name="preferred" value="0x2"
1270 summary="indicates this is the preferred mode"/>
1274 <description summary="advertise available modes for the output">
1275 The mode event describes an available mode for the output.
1276 The event is sent when binding to the output object and there
1277 will always be one mode, the current mode. The event is sent
1278 again if an output changes mode, for the mode that is now
1279 current. In other words, the current mode is always the last
1280 mode that was received with the current flag set.
1282 <arg name="flags" type="uint" summary="mask of wl_output_mode flags"/>
1283 <arg name="width" type="int" summary="width of the mode in pixels"/>
1284 <arg name="height" type="int" summary="height of the mode in pixels"/>
1285 <arg name="refresh" type="int" summary="vertical refresh rate in mHz"/>
1289 <interface name="wl_region" version="1">
1290 <description summary="region interface">
1294 <request name="destroy" type="destructor">
1295 <description summary="destroy region">
1296 Destroy the region. This will invalidate the object id.
1300 <request name="add">
1301 <description summary="add rectangle to region">
1302 Add the specified rectangle to the region
1305 <arg name="x" type="int"/>
1306 <arg name="y" type="int"/>
1307 <arg name="width" type="int"/>
1308 <arg name="height" type="int"/>
1311 <request name="subtract">
1312 <description summary="subtract rectangle from region">
1313 Subtract the specified rectangle from the region
1316 <arg name="x" type="int"/>
1317 <arg name="y" type="int"/>
1318 <arg name="width" type="int"/>
1319 <arg name="height" type="int"/>