xdg-shell: Document that xdg_surface.set_window_geometry needs a commit
[platform/upstream/weston.git] / protocol / xdg-shell.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="xdg_shell">
3
4   <copyright>
5     Copyright © 2008-2013 Kristian Høgsberg
6     Copyright © 2013      Rafael Antognolli
7     Copyright © 2013      Jasper St. Pierre
8     Copyright © 2010-2013 Intel Corporation
9
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
20     warranty.
21
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
29     THIS SOFTWARE.
30   </copyright>
31
32   <interface name="xdg_shell" version="1">
33     <description summary="create desktop-style surfaces">
34       xdg_shell allows clients to turn a wl_surface into a "real window"
35       which can be dragged, resized, stacked, and moved around by the
36       user. Everything about this interface is suited towards traditional
37       desktop environments.
38     </description>
39
40     <enum name="version">
41       <description summary="latest protocol version">
42         The 'current' member of this enum gives the version of the
43         protocol.  Implementations can compare this to the version
44         they implement using static_assert to ensure the protocol and
45         implementation versions match.
46       </description>
47       <entry name="current" value="5" summary="Always the latest version"/>
48     </enum>
49
50     <enum name="error">
51       <entry name="role" value="0" summary="given wl_surface has another role"/>
52       <entry name="defunct_surfaces" value="1" summary="xdg_shell was destroyed before children"/>
53       <entry name="not_the_topmost_popup" value="2" summary="the client tried to map or destroy a non-topmost popup"/>
54       <entry name="invalid_popup_parent" value="3" summary="the client specified an invalid popup parent surface"/>
55     </enum>
56
57     <request name="destroy" type="destructor">
58       <description summary="destroy xdg_shell">
59         Destroy this xdg_shell object.
60
61         Destroying a bound xdg_shell object while there are surfaces
62         still alive created by this xdg_shell object instance is illegal
63         and will result in a protocol error.
64       </description>
65     </request>
66
67     <request name="use_unstable_version">
68       <description summary="enable use of this unstable version">
69         Negotiate the unstable version of the interface.  This
70         mechanism is in place to ensure client and server agree on the
71         unstable versions of the protocol that they speak or exit
72         cleanly if they don't agree.  This request will go away once
73         the xdg-shell protocol is stable.
74       </description>
75       <arg name="version" type="int"/>
76     </request>
77
78     <request name="get_xdg_surface">
79       <description summary="create a shell surface from a surface">
80         This creates an xdg_surface for the given surface and gives it the
81         xdg_surface role. See the documentation of xdg_surface for more details.
82       </description>
83       <arg name="id" type="new_id" interface="xdg_surface"/>
84       <arg name="surface" type="object" interface="wl_surface"/>
85     </request>
86
87     <request name="get_xdg_popup">
88       <description summary="create a popup for a surface">
89         This creates an xdg_popup for the given surface and gives it the
90         xdg_popup role. See the documentation of xdg_popup for more details.
91
92         This request must be used in response to some sort of user action
93         like a button press, key press, or touch down event.
94       </description>
95       <arg name="id" type="new_id" interface="xdg_popup"/>
96       <arg name="surface" type="object" interface="wl_surface"/>
97       <arg name="parent" type="object" interface="wl_surface"/>
98       <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
99       <arg name="serial" type="uint" summary="the serial of the user event"/>
100       <arg name="x" type="int"/>
101       <arg name="y" type="int"/>
102     </request>
103
104     <event name="ping">
105       <description summary="check if the client is alive">
106         The ping event asks the client if it's still alive. Pass the
107         serial specified in the event back to the compositor by sending
108         a "pong" request back with the specified serial.
109
110         Compositors can use this to determine if the client is still
111         alive. It's unspecified what will happen if the client doesn't
112         respond to the ping request, or in what timeframe. Clients should
113         try to respond in a reasonable amount of time.
114       </description>
115       <arg name="serial" type="uint" summary="pass this to the pong request"/>
116     </event>
117
118     <request name="pong">
119       <description summary="respond to a ping event">
120         A client must respond to a ping event with a pong request or
121         the client may be deemed unresponsive.
122       </description>
123       <arg name="serial" type="uint" summary="serial of the ping event"/>
124     </request>
125   </interface>
126
127   <interface name="xdg_surface" version="1">
128     <description summary="A desktop window">
129       An interface that may be implemented by a wl_surface, for
130       implementations that provide a desktop-style user interface.
131
132       It provides requests to treat surfaces like windows, allowing to set
133       properties like maximized, fullscreen, minimized, and to move and resize
134       them, and associate metadata like title and app id.
135
136       The client must call wl_surface.commit on the corresponding wl_surface
137       for the xdg_surface state to take effect. Prior to committing the new
138       state, it can set up initial configuration, such as maximizing or setting
139       a window geometry.
140
141       Even without attaching a buffer the compositor must respond to initial
142       committed configuration, for instance sending a configure event with
143       expected window geometry if the client maximized its surface during
144       initialization.
145
146       For a surface to be mapped by the compositor the client must have
147       committed both an xdg_surface state and a buffer.
148     </description>
149
150     <request name="destroy" type="destructor">
151       <description summary="Destroy the xdg_surface">
152         Unmap and destroy the window. The window will be effectively
153         hidden from the user's point of view, and all state like
154         maximization, fullscreen, and so on, will be lost.
155       </description>
156     </request>
157
158     <request name="set_parent">
159       <description summary="set the parent of this surface">
160         Set the "parent" of this surface. This window should be stacked
161         above a parent. The parent surface must be mapped as long as this
162         surface is mapped.
163
164         Parent windows should be set on dialogs, toolboxes, or other
165         "auxiliary" surfaces, so that the parent is raised when the dialog
166         is raised.
167       </description>
168       <arg name="parent" type="object" interface="xdg_surface" allow-null="true"/>
169     </request>
170
171     <request name="set_title">
172       <description summary="set surface title">
173         Set a short title for the surface.
174
175         This string may be used to identify the surface in a task bar,
176         window list, or other user interface elements provided by the
177         compositor.
178
179         The string must be encoded in UTF-8.
180       </description>
181       <arg name="title" type="string"/>
182     </request>
183
184     <request name="set_app_id">
185       <description summary="set application ID">
186         Set an application identifier for the surface.
187
188         The app ID identifies the general class of applications to which
189         the surface belongs. The compositor can use this to group multiple
190         applications together, or to determine how to launch a new
191         application.
192
193         See the desktop-entry specification [0] for more details on
194         application identifiers and how they relate to well-known DBus
195         names and .desktop files.
196
197         [0] http://standards.freedesktop.org/desktop-entry-spec/
198       </description>
199       <arg name="app_id" type="string"/>
200     </request>
201
202     <request name="show_window_menu">
203       <description summary="show the window menu">
204         Clients implementing client-side decorations might want to show
205         a context menu when right-clicking on the decorations, giving the
206         user a menu that they can use to maximize or minimize the window.
207
208         This request asks the compositor to pop up such a window menu at
209         the given position, relative to the local surface coordinates of
210         the parent surface. There are no guarantees as to what menu items
211         the window menu contains.
212
213         This request must be used in response to some sort of user action
214         like a button press, key press, or touch down event.
215       </description>
216
217       <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
218       <arg name="serial" type="uint" summary="the serial of the user event"/>
219       <arg name="x" type="int" summary="the x position to pop up the window menu at"/>
220       <arg name="y" type="int" summary="the y position to pop up the window menu at"/>
221     </request>
222
223     <request name="move">
224       <description summary="start an interactive move">
225         Start an interactive, user-driven move of the surface.
226
227         This request must be used in response to some sort of user action
228         like a button press, key press, or touch down event.
229
230         The server may ignore move requests depending on the state of
231         the surface (e.g. fullscreen or maximized).
232       </description>
233       <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
234       <arg name="serial" type="uint" summary="the serial of the user event"/>
235     </request>
236
237     <enum name="resize_edge">
238       <description summary="edge values for resizing">
239         These values are used to indicate which edge of a surface
240         is being dragged in a resize operation. The server may
241         use this information to adapt its behavior, e.g. choose
242         an appropriate cursor image.
243       </description>
244       <entry name="none" value="0"/>
245       <entry name="top" value="1"/>
246       <entry name="bottom" value="2"/>
247       <entry name="left" value="4"/>
248       <entry name="top_left" value="5"/>
249       <entry name="bottom_left" value="6"/>
250       <entry name="right" value="8"/>
251       <entry name="top_right" value="9"/>
252       <entry name="bottom_right" value="10"/>
253     </enum>
254
255     <request name="resize">
256       <description summary="start an interactive resize">
257         Start a user-driven, interactive resize of the surface.
258
259         This request must be used in response to some sort of user action
260         like a button press, key press, or touch down event.
261
262         The server may ignore resize requests depending on the state of
263         the surface (e.g. fullscreen or maximized).
264       </description>
265       <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
266       <arg name="serial" type="uint" summary="the serial of the user event"/>
267       <arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
268     </request>
269
270     <enum name="state">
271       <description summary="types of state on the surface">
272         The different state values used on the surface. This is designed for
273         state values like maximized, fullscreen. It is paired with the
274         configure event to ensure that both the client and the compositor
275         setting the state can be synchronized.
276
277         States set in this way are double-buffered. They will get applied on
278         the next commit.
279
280         Desktop environments may extend this enum by taking up a range of
281         values and documenting the range they chose in this description.
282         They are not required to document the values for the range that they
283         chose. Ideally, any good extensions from a desktop environment should
284         make its way into standardization into this enum.
285
286         The current reserved ranges are:
287
288         0x0000 - 0x0FFF: xdg-shell core values, documented below.
289         0x1000 - 0x1FFF: GNOME
290       </description>
291       <entry name="maximized" value="1" summary="the surface is maximized">
292         The surface is maximized. The window geometry specified in the configure
293         event must be obeyed by the client.
294       </entry>
295       <entry name="fullscreen" value="2" summary="the surface is fullscreen">
296         The surface is fullscreen. The window geometry specified in the configure
297         event must be obeyed by the client.
298       </entry>
299       <entry name="resizing" value="3">
300         The surface is being resized. The window geometry specified in the
301         configure event is a maximum; the client cannot resize beyond it.
302         Clients that have aspect ratio or cell sizing configuration can use
303         a smaller size, however.
304       </entry>
305       <entry name="activated" value="4">
306         Client window decorations should be painted as if the window is
307         active. Do not assume this means that the window actually has
308         keyboard or pointer focus.
309       </entry>
310     </enum>
311
312     <event name="configure">
313       <description summary="suggest a surface change">
314         The configure event asks the client to resize its surface or to
315         change its state.
316
317         The width and height arguments specify a hint to the window
318         about how its surface should be resized in window geometry
319         coordinates.
320
321         The states listed in the event specify how the width/height
322         arguments should be interpreted, and possibly how it should be
323         drawn.
324
325         Clients should arrange their surface for the new size and
326         states, and then send a ack_configure request with the serial
327         sent in this configure event at some point before committing
328         the new surface.
329
330         If the client receives multiple configure events before it
331         can respond to one, it is free to discard all but the last
332         event it received.
333       </description>
334
335       <arg name="width" type="int"/>
336       <arg name="height" type="int"/>
337       <arg name="states" type="array"/>
338       <arg name="serial" type="uint"/>
339     </event>
340
341     <request name="ack_configure">
342       <description summary="ack a configure event">
343         When a configure event is received, if a client commits the
344         surface in response to the configure event, then the client
345         must make a ack_configure request before the commit request,
346         passing along the serial of the configure event.
347
348         The compositor might use this information to move a surface
349         to the top left only when the client has drawn itself for
350         the maximized or fullscreen state.
351
352         If the client receives multiple configure events before it
353         can respond to one, it only has to ack the last configure event.
354       </description>
355       <arg name="serial" type="uint" summary="the serial from the configure event"/>
356     </request>
357
358     <request name="set_window_geometry">
359       <description summary="set the new window geometry">
360         The window geometry of a window is its "visible bounds" from the
361         user's perspective. Client-side decorations often have invisible
362         portions like drop-shadows which should be ignored for the
363         purposes of aligning, placing and constraining windows.
364
365         The window geometry is double buffered, and will be applied at the
366         time wl_surface.commit of the corresponding wl_surface is called.
367
368         Once the window geometry of the surface is set once, it is not
369         possible to unset it, and it will remain the same until
370         set_window_geometry is called again, even if a new subsurface or
371         buffer is attached.
372
373         If never set, the value is the full bounds of the surface,
374         including any subsurfaces. This updates dynamically on every
375         commit. This unset mode is meant for extremely simple clients.
376
377         If responding to a configure event, the window geometry in here
378         must respect the sizing negotiations specified by the states in
379         the configure event.
380
381         The width and height must be greater than zero.
382       </description>
383       <arg name="x" type="int"/>
384       <arg name="y" type="int"/>
385       <arg name="width" type="int"/>
386       <arg name="height" type="int"/>
387     </request>
388
389     <request name="set_maximized" />
390     <request name="unset_maximized" />
391
392     <request name="set_fullscreen">
393       <description summary="set the window as fullscreen on a monitor">
394         Make the surface fullscreen.
395
396         You can specify an output that you would prefer to be fullscreen.
397         If this value is NULL, it's up to the compositor to choose which
398         display will be used to map this surface.
399       </description>
400       <arg name="output" type="object" interface="wl_output" allow-null="true"/>
401     </request>
402     <request name="unset_fullscreen" />
403
404     <request name="set_minimized">
405       <description summary="set the window as minimized">
406         Request that the compositor minimize your surface. There is no
407         way to know if the surface is currently minimized, nor is there
408         any way to unset minimization on this surface.
409
410         If you are looking to throttle redrawing when minimized, please
411         instead use the wl_surface.frame event for this, as this will
412         also work with live previews on windows in Alt-Tab, Expose or
413         similar compositor features.
414       </description>
415     </request>
416
417     <event name="close">
418       <description summary="surface wants to be closed">
419         The close event is sent by the compositor when the user
420         wants the surface to be closed. This should be equivalent to
421         the user clicking the close button in client-side decorations,
422         if your application has any...
423
424         This is only a request that the user intends to close your
425         window. The client may choose to ignore this request, or show
426         a dialog to ask the user to save their data...
427       </description>
428     </event>
429   </interface>
430
431   <interface name="xdg_popup" version="1">
432     <description summary="short-lived, popup surfaces for menus">
433       A popup surface is a short-lived, temporary surface that can be
434       used to implement menus. It takes an explicit grab on the surface
435       that will be dismissed when the user dismisses the popup. This can
436       be done by the user clicking outside the surface, using the keyboard,
437       or even locking the screen through closing the lid or a timeout.
438
439       When the popup is dismissed, a popup_done event will be sent out,
440       and at the same time the surface will be unmapped. The xdg_popup
441       object is now inert and cannot be reactivated, so clients should
442       destroy it. Explicitly destroying the xdg_popup object will also
443       dismiss the popup and unmap the surface.
444
445       Clients will receive events for all their surfaces during this
446       grab (which is an "owner-events" grab in X11 parlance). This is
447       done so that users can navigate through submenus and other
448       "nested" popup windows without having to dismiss the topmost
449       popup.
450
451       Clients that want to dismiss the popup when another surface of
452       their own is clicked should dismiss the popup using the destroy
453       request.
454
455       The parent surface must have either an xdg_surface or xdg_popup
456       role.
457
458       Specifying an xdg_popup for the parent means that the popups are
459       nested, with this popup now being the topmost popup. Nested
460       popups must be destroyed in the reverse order they were created
461       in, e.g. the only popup you are allowed to destroy at all times
462       is the topmost one.
463
464       If there is an existing popup when creating a new popup, the
465       parent must be the current topmost popup.
466
467       A parent surface must be mapped before the new popup is mapped.
468
469       When compositors choose to dismiss a popup, they will likely
470       dismiss every nested popup as well.
471
472       The x and y arguments specify where the top left of the popup
473       should be placed, relative to the local surface coordinates of the
474       parent surface.
475
476       The client must call wl_surface.commit on the corresponding wl_surface
477       for the xdg_popup state to take effect.
478
479       For a surface to be mapped by the compositor the client must have
480       committed both the xdg_popup state and a buffer.
481     </description>
482
483     <request name="destroy" type="destructor">
484       <description summary="remove xdg_popup interface">
485         This destroys the popup. Explicitly destroying the xdg_popup
486         object will also dismiss the popup, and unmap the surface.
487
488         If this xdg_popup is not the "topmost" popup, a protocol error
489         will be sent.
490       </description>
491     </request>
492
493     <event name="popup_done">
494       <description summary="popup interaction is done">
495         The popup_done event is sent out when a popup is dismissed
496         by the compositor.
497       </description>
498     </event>
499
500   </interface>
501 </protocol>