wlr-layer-shell-unstable-v1.xml 19 KB

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