1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="xdg_shell">
5 Copyright © 2008-2013 Kristian Høgsberg
6 Copyright © 2013 Rafael Antognolli
7 Copyright © 2013 Jasper St. Pierre
8 Copyright © 2010-2013 Intel Corporation
10 Permission to use, copy, modify, distribute, and sell this
11 software and its documentation for any purpose is hereby granted
12 without fee, provided that the above copyright notice appear in
13 all copies and that both that copyright notice and this permission
14 notice appear in supporting documentation, and that the name of
15 the copyright holders not be used in advertising or publicity
16 pertaining to distribution of the software without specific,
17 written prior permission. The copyright holders make no
18 representations about the suitability of this software for any
19 purpose. It is provided "as is" without express or implied
22 THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
23 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
25 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
28 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
32 <interface name="xdg_shell" version="1">
33 <description summary="create desktop-style surfaces">
34 This interface is implemented by servers that provide
35 desktop-style user interfaces.
37 It allows clients to associate a xdg_surface with
42 <description summary="latest protocol version">
43 The 'current' member of this enum gives the version of the
44 protocol. Implementations can compare this to the version
45 they implement using static_assert to ensure the protocol and
46 implementation versions match.
48 <entry name="current" value="3" summary="Always the latest version"/>
52 <request name="use_unstable_version">
53 <description summary="enable use of this unstable version">
54 Negotiate the unstable version of the interface. This
55 mechanism is in place to ensure client and server agree on the
56 unstable versions of the protocol that they speak or exit
57 cleanly if they don't agree. This request will go away once
58 the xdg-shell protocol is stable.
60 <arg name="version" type="int"/>
63 <request name="get_xdg_surface">
64 <description summary="create a shell surface from a surface">
65 Create a shell surface for an existing surface.
67 Only one shell or popup surface can be associated with a given
70 <arg name="id" type="new_id" interface="xdg_surface"/>
71 <arg name="surface" type="object" interface="wl_surface"/>
74 <request name="get_xdg_popup">
75 <description summary="create a shell surface from a surface">
76 Create a popup surface for an existing surface.
78 Only one shell or popup surface can be associated with a given
81 <arg name="id" type="new_id" interface="xdg_popup"/>
82 <arg name="surface" type="object" interface="wl_surface"/>
83 <arg name="parent" type="object" interface="wl_surface"/>
84 <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/>
85 <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
86 <arg name="x" type="int"/>
87 <arg name="y" type="int"/>
88 <arg name="flags" type="uint"/>
92 <description summary="check if the client is alive">
93 The ping event asks the client if it's still alive. Pass the
94 serial specified in the event back to the compositor by sending
95 a "pong" request back with the specified serial.
97 Compositors can use this to determine if the client is still
98 alive. It's unspecified what will happen if the client doesn't
99 respond to the ping request, or in what timeframe. Clients should
100 try to respond in a reasonable amount of time.
102 <arg name="serial" type="uint" summary="pass this to the callback"/>
105 <request name="pong">
106 <description summary="respond to a ping event">
107 A client must respond to a ping event with a pong request or
108 the client may be deemed unresponsive.
110 <arg name="serial" type="uint" summary="serial of the ping event"/>
114 <interface name="xdg_surface" version="1">
116 <description summary="desktop-style metadata interface">
117 An interface that may be implemented by a wl_surface, for
118 implementations that provide a desktop-style user interface.
120 It provides requests to treat surfaces like windows, allowing to set
121 properties like maximized, fullscreen, minimized, and to move and resize
122 them, and associate metadata like title and app id.
124 On the server side the object is automatically destroyed when
125 the related wl_surface is destroyed. On client side,
126 xdg_surface.destroy() must be called before destroying
127 the wl_surface object.
130 <request name="destroy" type="destructor">
131 <description summary="remove xdg_surface interface">
132 The xdg_surface interface is removed from the wl_surface object
133 that was turned into a xdg_surface with
134 xdg_shell.get_xdg_surface request. The xdg_surface properties,
135 like maximized and fullscreen, are lost. The wl_surface loses
136 its role as a xdg_surface. The wl_surface is unmapped.
140 <request name="set_transient_for">
141 <description summary="surface is a child of another surface">
142 Setting a surface as transient of another means that it is child
145 Child surfaces are stacked above their parents, and will be
146 unmapped if the parent is unmapped too. They should not appear
147 on task bars and alt+tab.
149 <arg name="parent" type="object" interface="wl_surface" allow-null="true"/>
152 <request name="set_margin">
153 <description summary="set the visible frame boundaries">
154 This tells the compositor what the visible size of the window
155 should be, so it can use it to determine what borders to use for
156 constrainment and alignment.
158 CSD often has invisible areas for decoration purposes, like drop
159 shadows. These "shadow" drawings need to be subtracted out of the
160 normal boundaries of the window when computing where to place
161 windows (e.g. to set this window so it's centered on top of another,
162 or to put it to the left or right of the screen.)
164 This value should change as little as possible at runtime, to
167 This value is also ignored when the window is maximized or
168 fullscreen, and assumed to be 0.
170 If never called, this value is assumed to be 0.
172 <arg name="left_margin" type="int"/>
173 <arg name="right_margin" type="int"/>
174 <arg name="top_margin" type="int"/>
175 <arg name="bottom_margin" type="int"/>
178 <request name="set_title">
179 <description summary="set surface title">
180 Set a short title for the surface.
182 This string may be used to identify the surface in a task bar,
183 window list, or other user interface elements provided by the
186 The string must be encoded in UTF-8.
188 <arg name="title" type="string"/>
191 <request name="set_app_id">
192 <description summary="set surface class">
193 Set an id for the surface.
195 The app id identifies the general class of applications to which
198 It should be the ID that appears in the new desktop entry
199 specification, the interface name.
201 <arg name="app_id" type="string"/>
204 <request name="move">
205 <description summary="start an interactive move">
206 Start a pointer-driven move of the surface.
208 This request must be used in response to a button press event.
209 The server may ignore move requests depending on the state of
210 the surface (e.g. fullscreen or maximized).
212 <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/>
213 <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
216 <enum name="resize_edge">
217 <description summary="edge values for resizing">
218 These values are used to indicate which edge of a surface
219 is being dragged in a resize operation. The server may
220 use this information to adapt its behavior, e.g. choose
221 an appropriate cursor image.
223 <entry name="none" value="0"/>
224 <entry name="top" value="1"/>
225 <entry name="bottom" value="2"/>
226 <entry name="left" value="4"/>
227 <entry name="top_left" value="5"/>
228 <entry name="bottom_left" value="6"/>
229 <entry name="right" value="8"/>
230 <entry name="top_right" value="9"/>
231 <entry name="bottom_right" value="10"/>
234 <request name="resize">
235 <description summary="start an interactive resize">
236 Start a pointer-driven resizing of the surface.
238 This request must be used in response to a button press event.
239 The server may ignore resize requests depending on the state of
240 the surface (e.g. fullscreen or maximized).
242 <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/>
243 <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
244 <arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
247 <event name="configure">
248 <description summary="suggest resize">
249 The configure event asks the client to resize its surface.
251 The size is a hint, in the sense that the client is free to
252 ignore it if it doesn't resize, pick a smaller size (to
253 satisfy aspect ratio or resize in steps of NxM pixels).
255 The client is free to dismiss all but the last configure
258 The width and height arguments specify the size of the window
259 in surface local coordinates.
262 <arg name="width" type="int"/>
263 <arg name="height" type="int"/>
266 <request name="set_output">
267 <description summary="set the default output used by this surface">
268 Set the default output used by this surface when it is first mapped.
270 If this value is NULL (default), it's up to the compositor to choose
271 which display will be used to map this surface.
273 When fullscreen or maximized state are set on this surface, and it
274 wasn't mapped yet, the output set with this method will be used.
275 Otherwise, the output where the surface is currently mapped will be
278 <arg name="output" type="object" interface="wl_output" allow-null="true"/>
282 <description summary="types of state on the surface">
283 The different state values used on the surface. This is designed for
284 state values like maximized, fullscreen. It is paired with the
285 request_change_state event to ensure that both the client and the
286 compositor setting the state can be synchronized.
288 States set in this way are double-buffered. They will get applied on
291 Desktop environments may extend this enum by taking up a range of
292 values and documenting the range they chose in this description.
293 They are not required to document the values for the range that they
294 chose. Ideally, any good extensions from a desktop environment should
295 make its way into standardization into this enum.
297 The current reserved ranges are:
299 0x0000 - 0x0FFF: xdg-shell core values, documented below.
300 0x1000 - 0x1FFF: GNOME
302 <entry name="maximized" value="1" summary="the surface is maximized">
303 A non-zero value indicates the surface is maximized. Otherwise,
304 the surface is unmaximized.
306 <entry name="fullscreen" value="2" summary="the surface is fullscreen">
307 A non-zero value indicates the surface is fullscreen. Otherwise,
308 the surface is not fullscreen.
312 <request name="request_change_state">
313 <description summary="client requests to change a surface's state">
314 This asks the compositor to change the state. If the compositor wants
315 to change the state, it will send a change_state event with the same
316 state_type, value, and serial, and the event flow continues as if it
317 it was initiated by the compositor.
319 If the compositor does not want to change the state, it will send a
320 change_state to the client with the old value of the state.
322 <arg name="state_type" type="uint" summary="the state to set"/>
323 <arg name="value" type="uint" summary="the value to change the state to"/>
324 <arg name="serial" type="uint" summary="an event serial">
325 This serial is so the client can know which change_state event corresponds
326 to which request_change_state request it sent out.
330 <event name="change_state">
331 <description summary="compositor wants to change a surface's state">
332 This event tells the client to change a surface's state. The client
333 should respond with an ack_change_state request to the compositor to
334 guarantee that the compositor knows that the client has seen it.
337 <arg name="state_type" type="uint" summary="the state to set"/>
338 <arg name="value" type="uint" summary="the value to change the state to"/>
339 <arg name="serial" type="uint" summary="a serial for the compositor's own tracking"/>
342 <request name="ack_change_state">
343 <description summary="ack a change_state event">
344 When a change_state event is received, a client should then ack it
345 using the ack_change_state request to ensure that the compositor
346 knows the client has seen the event.
348 By this point, the state is confirmed, and the next attach should
349 contain the buffer drawn for the new state value.
351 The values here need to be the same as the values in the cooresponding
354 <arg name="state_type" type="uint" summary="the state to set"/>
355 <arg name="value" type="uint" summary="the value to change the state to"/>
356 <arg name="serial" type="uint" summary="a serial to pass to change_state"/>
359 <request name="set_minimized">
360 <description summary="minimize the surface">
361 Minimize the surface.
365 <event name="activated">
366 <description summary="surface was activated">
367 The activated_set event is sent when this surface has been
368 activated, which means that the surface has user attention.
369 Window decorations should be updated accordingly. You should
370 not use this event for anything but the style of decorations
371 you display, use wl_keyboard.enter and wl_keyboard.leave for
372 determining keyboard focus.
376 <event name="deactivated">
377 <description summary="surface was deactivated">
378 The deactivate event is sent when this surface has been
379 deactivated, which means that the surface lost user attention.
380 Window decorations should be updated accordingly. You should
381 not use this event for anything but the style of decorations
382 you display, use wl_keyboard.enter and wl_keyboard.leave for
383 determining keyboard focus.
388 <description summary="surface wants to be closed">
389 The close event is sent by the compositor when the user
390 wants the surface to be closed. This should be equivalent to
391 the user clicking the close button in client-side decorations,
392 if your application has any...
394 This is only a request that the user intends to close your
395 window. The client may choose to ignore this request, or show
396 a dialog to ask the user to save their data...
401 <interface name="xdg_popup" version="1">
402 <description summary="desktop-style metadata interface">
403 An interface that may be implemented by a wl_surface, for
404 implementations that provide a desktop-style popups/menus. A popup
405 surface is a transient surface with an added pointer grab.
407 An existing implicit grab will be changed to owner-events mode,
408 and the popup grab will continue after the implicit grab ends
409 (i.e. releasing the mouse button does not cause the popup to be
412 The popup grab continues until the window is destroyed or a mouse
413 button is pressed in any other clients window. A click in any of
414 the clients surfaces is reported as normal, however, clicks in
415 other clients surfaces will be discarded and trigger the callback.
417 The x and y arguments specify the locations of the upper left
418 corner of the surface relative to the upper left corner of the
419 parent surface, in surface local coordinates.
421 xdg_popup surfaces are always transient for another surface.
424 <request name="destroy" type="destructor">
425 <description summary="remove xdg_surface interface">
426 The xdg_surface interface is removed from the wl_surface object
427 that was turned into a xdg_surface with
428 xdg_shell.get_xdg_surface request. The xdg_surface properties,
429 like maximized and fullscreen, are lost. The wl_surface loses
430 its role as a xdg_surface. The wl_surface is unmapped.
434 <event name="popup_done">
435 <description summary="popup interaction is done">
436 The popup_done event is sent out when a popup grab is broken,
437 that is, when the users clicks a surface that doesn't belong
438 to the client owning the popup surface.
440 <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>