@@ -140,3 +140,61 @@ pub mod shell {
140140 [ ]
141141 ) ;
142142}
143+
144+ #[ cfg( feature = "staging" ) ]
145+ pub mod toplevel_drag {
146+ //! This protocol enhances normal drag and drop with the ability to move a
147+ //! window at the same time. This allows having detachable parts of a window
148+ //! that when dragged out of it become a new window and can be dragged over
149+ //! an existing window to be reattached.
150+ //!
151+ //! A typical workflow would be when the user starts dragging on top of a
152+ //! detachable part of a window, the client would create a `wl_data_source` and
153+ //! a `xdg_toplevel_drag_v1` object and start the drag as normal via
154+ //! `wl_data_device.start_drag`. Once the client determines that the detachable
155+ //! window contents should be detached from the originating window, it creates
156+ //! a new `xdg_toplevel` with these contents and issues a
157+ //! `xdg_toplevel_drag_v1.attach` request before mapping it. From now on the new
158+ //! window is moved by the compositor during the drag as if the client called
159+ //! `xdg_toplevel.move`.
160+ //!
161+ //! Dragging an existing window is similar. The client creates a
162+ //! `xdg_toplevel_drag_v1` object and attaches the existing toplevel before
163+ //! starting the drag.
164+ //!
165+ //! Clients use the existing drag and drop mechanism to detect when a window
166+ //! can be docked or undocked. If the client wants to snap a window into a
167+ //! parent window it should delete or unmap the dragged top-level. If the
168+ //! contents should be detached again it attaches a new toplevel as described
169+ //! above. If a drag operation is cancelled without being dropped, clients
170+ //! should revert to the previous state, deleting any newly created windows
171+ //! as appropriate. When a drag operation ends as indicated by
172+ //! `wl_data_source.dnd_drop_performed` the dragged toplevel window's final
173+ //! position is determined as if a `xdg_toplevel_move` operation ended.
174+
175+ /// Version 1
176+ pub mod v1 {
177+ wayland_protocol ! (
178+ "./protocols/staging/xdg-toplevel-drag/xdg-toplevel-drag-v1.xml" ,
179+ [ crate :: xdg:: shell]
180+ ) ;
181+ }
182+ }
183+
184+ #[ cfg( feature = "staging" ) ]
185+ pub mod dialog {
186+ //! The `xdg_wm_dialog_v1` interface is exposed as a global object allowing
187+ //! to register surfaces with a xdg_toplevel role as "dialogs" relative to
188+ //! another toplevel.
189+ //!
190+ //! The compositor may let this relation influence how the surface is
191+ //! placed, displayed or interacted with.
192+
193+ /// Version 1
194+ pub mod v1 {
195+ wayland_protocol ! (
196+ "./protocols/staging/xdg-dialog/xdg-dialog-v1.xml" ,
197+ [ crate :: xdg:: shell]
198+ ) ;
199+ }
200+ }
0 commit comments