ext-foreign-toplevel-list-v1.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <protocol name="ext_foreign_toplevel_list_v1">
  3. <copyright>
  4. Copyright © 2018 Ilia Bozhinov
  5. Copyright © 2020 Isaac Freund
  6. Copyright © 2022 wb9688
  7. Copyright © 2023 i509VCB
  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
  18. warranty.
  19. THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
  20. SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  21. FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
  22. SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  23. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
  24. AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  25. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  26. THIS SOFTWARE.
  27. </copyright>
  28. <description summary="list toplevels">
  29. The purpose of this protocol is to provide protocol object handles for
  30. toplevels, possibly originating from another client.
  31. This protocol is intentionally minimalistic and expects additional
  32. functionality (e.g. creating a screencopy source from a toplevel handle,
  33. getting information about the state of the toplevel) to be implemented
  34. in extension protocols.
  35. The compositor may choose to restrict this protocol to a special client
  36. launched by the compositor itself or expose it to all clients,
  37. this is compositor policy.
  38. The key words "must", "must not", "required", "shall", "shall not",
  39. "should", "should not", "recommended", "may", and "optional" in this
  40. document are to be interpreted as described in IETF RFC 2119.
  41. Warning! The protocol described in this file is currently in the testing
  42. phase. Backward compatible changes may be added together with the
  43. corresponding interface version bump. Backward incompatible changes can
  44. only be done by creating a new major version of the extension.
  45. </description>
  46. <interface name="ext_foreign_toplevel_list_v1" version="1">
  47. <description summary="list toplevels">
  48. A toplevel is defined as a surface with a role similar to xdg_toplevel.
  49. XWayland surfaces may be treated like toplevels in this protocol.
  50. After a client binds the ext_foreign_toplevel_list_v1, each mapped
  51. toplevel window will be sent using the ext_foreign_toplevel_list_v1.toplevel
  52. event.
  53. Clients which only care about the current state can perform a roundtrip after
  54. binding this global.
  55. For each instance of ext_foreign_toplevel_list_v1, the compositor must
  56. create a new ext_foreign_toplevel_handle_v1 object for each mapped toplevel.
  57. If a compositor implementation sends the ext_foreign_toplevel_list_v1.finished
  58. event after the global is bound, the compositor must not send any
  59. ext_foreign_toplevel_list_v1.toplevel events.
  60. </description>
  61. <event name="toplevel">
  62. <description summary="a toplevel has been created">
  63. This event is emitted whenever a new toplevel window is created. It is
  64. emitted for all toplevels, regardless of the app that has created them.
  65. All initial properties of the toplevel (identifier, title, app_id) will be sent
  66. immediately after this event using the corresponding events for
  67. ext_foreign_toplevel_handle_v1. The compositor will use the
  68. ext_foreign_toplevel_handle_v1.done event to indicate when all data has
  69. been sent.
  70. </description>
  71. <arg name="toplevel" type="new_id" interface="ext_foreign_toplevel_handle_v1"/>
  72. </event>
  73. <event name="finished">
  74. <description summary="the compositor has finished with the toplevel manager">
  75. This event indicates that the compositor is done sending events
  76. to this object. The client should destroy the object.
  77. See ext_foreign_toplevel_list_v1.destroy for more information.
  78. The compositor must not send any more toplevel events after this event.
  79. </description>
  80. </event>
  81. <request name="stop">
  82. <description summary="stop sending events">
  83. This request indicates that the client no longer wishes to receive
  84. events for new toplevels.
  85. The Wayland protocol is asynchronous, meaning the compositor may send
  86. further toplevel events until the stop request is processed.
  87. The client should wait for a ext_foreign_toplevel_list_v1.finished
  88. event before destroying this object.
  89. </description>
  90. </request>
  91. <request name="destroy" type="destructor">
  92. <description summary="destroy the ext_foreign_toplevel_list_v1 object">
  93. This request should be called either when the client will no longer
  94. use the ext_foreign_toplevel_list_v1 or after the finished event
  95. has been received to allow destruction of the object.
  96. If a client wishes to destroy this object it should send a
  97. ext_foreign_toplevel_list_v1.stop request and wait for a ext_foreign_toplevel_list_v1.finished
  98. event, then destroy the handles and then this object.
  99. </description>
  100. </request>
  101. </interface>
  102. <interface name="ext_foreign_toplevel_handle_v1" version="1">
  103. <description summary="a mapped toplevel">
  104. A ext_foreign_toplevel_handle_v1 object represents a mapped toplevel
  105. window. A single app may have multiple mapped toplevels.
  106. </description>
  107. <request name="destroy" type="destructor">
  108. <description summary="destroy the ext_foreign_toplevel_handle_v1 object">
  109. This request should be used when the client will no longer use the handle
  110. or after the closed event has been received to allow destruction of the
  111. object.
  112. When a handle is destroyed, a new handle may not be created by the server
  113. until the toplevel is unmapped and then remapped. Destroying a toplevel handle
  114. is not recommended unless the client is cleaning up child objects
  115. before destroying the ext_foreign_toplevel_list_v1 object, the toplevel
  116. was closed or the toplevel handle will not be used in the future.
  117. Other protocols which extend the ext_foreign_toplevel_handle_v1
  118. interface should require destructors for extension interfaces be
  119. called before allowing the toplevel handle to be destroyed.
  120. </description>
  121. </request>
  122. <event name="closed">
  123. <description summary="the toplevel has been closed">
  124. The server will emit no further events on the ext_foreign_toplevel_handle_v1
  125. after this event. Any requests received aside from the destroy request must
  126. be ignored. Upon receiving this event, the client should destroy the handle.
  127. Other protocols which extend the ext_foreign_toplevel_handle_v1
  128. interface must also ignore requests other than destructors.
  129. </description>
  130. </event>
  131. <event name="done">
  132. <description summary="all information about the toplevel has been sent">
  133. This event is sent after all changes in the toplevel state have
  134. been sent.
  135. This allows changes to the ext_foreign_toplevel_handle_v1 properties
  136. to be atomically applied. Other protocols which extend the
  137. ext_foreign_toplevel_handle_v1 interface may use this event to also
  138. atomically apply any pending state.
  139. This event must not be sent after the ext_foreign_toplevel_handle_v1.closed
  140. event.
  141. </description>
  142. </event>
  143. <event name="title">
  144. <description summary="title change">
  145. The title of the toplevel has changed.
  146. The configured state must not be applied immediately. See
  147. ext_foreign_toplevel_handle_v1.done for details.
  148. </description>
  149. <arg name="title" type="string"/>
  150. </event>
  151. <event name="app_id">
  152. <description summary="app_id change">
  153. The app id of the toplevel has changed.
  154. The configured state must not be applied immediately. See
  155. ext_foreign_toplevel_handle_v1.done for details.
  156. </description>
  157. <arg name="app_id" type="string"/>
  158. </event>
  159. <event name="identifier">
  160. <description summary="a stable identifier for a toplevel">
  161. This identifier is used to check if two or more toplevel handles belong
  162. to the same toplevel.
  163. The identifier is useful for command line tools or privileged clients
  164. which may need to reference an exact toplevel across processes or
  165. instances of the ext_foreign_toplevel_list_v1 global.
  166. The compositor must only send this event when the handle is created.
  167. The identifier must be unique per toplevel and its handles. Two different
  168. toplevels must not have the same identifier. The identifier is only valid
  169. as long as the toplevel is mapped. If the toplevel is unmapped the identifier
  170. must not be reused. An identifier must not be reused by the compositor to
  171. ensure there are no races when sharing identifiers between processes.
  172. An identifier is a string that contains up to 32 printable ASCII bytes.
  173. An identifier must not be an empty string. It is recommended that a
  174. compositor includes an opaque generation value in identifiers. How the
  175. generation value is used when generating the identifier is implementation
  176. dependent.
  177. </description>
  178. <arg name="identifier" type="string"/>
  179. </event>
  180. </interface>
  181. </protocol>