Skip to content

Commit d9f2fde

Browse files
ids1024elinorbgr
authored andcommitted
Update wayland-protocols to 1.34
Adds xdg-toplevel-drag-v1, xdg-dialog-v1, and linux-drm-syncobj-v1.
1 parent 738cef0 commit d9f2fde

File tree

4 files changed

+97
-1
lines changed

4 files changed

+97
-1
lines changed

wayland-protocols/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# CHANGELOG: wayland-protocols
22

33
## Unreleased
4+
- Bump wayland-protocols to 1.34
5+
- New staging protocols:
6+
- `xdg-toplevel-drag-v1`
7+
- `xdg-dialog-v1`
8+
- `linux-drm-syncobj-v1`
49

510
## 0.31.2 -- 2024-01-29
611

wayland-protocols/protocols

Submodule protocols updated from 5434607 to c7e9c4f

wayland-protocols/src/wp.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,39 @@ pub mod linux_explicit_synchronization {
194194
}
195195
}
196196

197+
#[cfg(feature = "staging")]
198+
pub mod linux_drm_syncobj {
199+
//! This protocol allows clients to request explicit synchronization for
200+
//! buffers. It is tied to the Linux DRM synchronization object framework.
201+
//!
202+
//! Synchronization refers to co-ordination of pipelined operations performed
203+
//! on buffers. Most GPU clients will schedule an asynchronous operation to
204+
//! render to the buffer, then immediately send the buffer to the compositor
205+
//! to be attached to a surface.
206+
//!
207+
//! With implicit synchronization, ensuring that the rendering operation is
208+
//! complete before the compositor displays the buffer is an implementation
209+
//! detail handled by either the kernel or userspace graphics driver.
210+
//!
211+
//! By contrast, with explicit synchronization, DRM synchronization object
212+
//! timeline points mark when the asynchronous operations are complete. When
213+
//! submitting a buffer, the client provides a timeline point which will be
214+
//! waited on before the compositor accesses the buffer, and another timeline
215+
//! point that the compositor will signal when it no longer needs to access the
216+
//! buffer contents for the purposes of the surface commit.
217+
//!
218+
//! Linux DRM synchronization objects are documented at:
219+
//! <https://dri.freedesktop.org/docs/drm/gpu/drm-mm.html#drm-sync-objects>
220+
221+
/// Version 1
222+
pub mod v1 {
223+
wayland_protocol!(
224+
"./protocols/staging/linux-drm-syncobj/linux-drm-syncobj-v1.xml",
225+
[]
226+
);
227+
}
228+
}
229+
197230
#[cfg(feature = "unstable")]
198231
pub mod pointer_constraints {
199232
//! protocol for constraining pointer motions

wayland-protocols/src/xdg.rs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)