diff --git a/docs/features.md b/docs/features.md index b1795fc0..453be002 100644 --- a/docs/features.md +++ b/docs/features.md @@ -163,7 +163,7 @@ Jay supports the following wayland protocols: | wp_color_manager_v1 | 1[^color_mng] | | | wp_commit_timing_manager_v1 | 1 | | | wp_content_type_manager_v1 | 1 | | -| wp_cursor_shape_manager_v1 | 1 | | +| wp_cursor_shape_manager_v1 | 2 | | | wp_drm_lease_device_v1 | 1 | | | wp_fifo_manager_v1 | 1 | | | wp_fractional_scale_manager_v1 | 1 | | diff --git a/release-notes.md b/release-notes.md index 490438d8..36786759 100644 --- a/release-notes.md +++ b/release-notes.md @@ -10,6 +10,7 @@ yellow. The blend buffer is only used for those areas of the screen where blending is observable. This should have no impact on performance in the common case. - Implement color-management-v1. +- Implement cursor-shape-v1 version 2. # 1.9.1 (2025-02-13) diff --git a/src/cursor.rs b/src/cursor.rs index faae24f7..95bbeaf2 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -111,6 +111,8 @@ pub struct ServerCursors { pub all_scroll: ServerCursorTemplate, pub zoom_in: ServerCursorTemplate, pub zoom_out: ServerCursorTemplate, + pub dnd_ask: ServerCursorTemplate, + pub all_resize: ServerCursorTemplate, } #[derive(Copy, Clone, Debug, Eq, PartialEq, FromPrimitive)] @@ -149,6 +151,8 @@ pub enum KnownCursor { AllScroll, ZoomIn, ZoomOut, + DndAsk, + AllResize, } impl ServerCursors { @@ -201,6 +205,8 @@ impl ServerCursors { all_scroll: load(&["all-scroll", "grabbing"])?, zoom_in: load(&["zoom-in"])?, zoom_out: load(&["zoom-out"])?, + dnd_ask: load(&["dnd-ask", "dnd-copy", "copy"])?, + all_resize: load(&["all-resize", "move"])?, })) } } diff --git a/src/cursor_user.rs b/src/cursor_user.rs index 56cc89bb..6b6d526e 100644 --- a/src/cursor_user.rs +++ b/src/cursor_user.rs @@ -328,6 +328,8 @@ impl CursorUser { KnownCursor::AllScroll => &cursors.all_scroll, KnownCursor::ZoomIn => &cursors.zoom_in, KnownCursor::ZoomOut => &cursors.zoom_out, + KnownCursor::DndAsk => &cursors.dnd_ask, + KnownCursor::AllResize => &cursors.all_resize, }; self.set_cursor2(Some( tpl.instantiate(&self.group.state, self.group.size.get()), diff --git a/src/ifs/wp_cursor_shape_device_v1.rs b/src/ifs/wp_cursor_shape_device_v1.rs index 9c021147..f1d4e307 100644 --- a/src/ifs/wp_cursor_shape_device_v1.rs +++ b/src/ifs/wp_cursor_shape_device_v1.rs @@ -45,6 +45,10 @@ const ROW_RESIZE: u32 = 31; const ALL_SCROLL: u32 = 32; const ZOOM_IN: u32 = 33; const ZOOM_OUT: u32 = 34; +const DND_ASK: u32 = 35; +const ALL_RESIZE: u32 = 36; + +const V2: Version = Version(2); pub enum CursorShapeCursorUser { Seat(Rc), @@ -103,6 +107,8 @@ impl WpCursorShapeDeviceV1RequestHandler for WpCursorShapeDeviceV1 { ALL_SCROLL => KnownCursor::AllScroll, ZOOM_IN => KnownCursor::ZoomIn, ZOOM_OUT => KnownCursor::ZoomOut, + DND_ASK if self.version >= V2 => KnownCursor::DndAsk, + ALL_RESIZE if self.version >= V2 => KnownCursor::AllResize, _ => return Err(WpCursorShapeDeviceV1Error::UnknownShape(req.shape)), }; let tablet_tool; diff --git a/src/ifs/wp_cursor_shape_manager_v1.rs b/src/ifs/wp_cursor_shape_manager_v1.rs index 2018ae5e..2b4b37f5 100644 --- a/src/ifs/wp_cursor_shape_manager_v1.rs +++ b/src/ifs/wp_cursor_shape_manager_v1.rs @@ -52,7 +52,7 @@ impl Global for WpCursorShapeManagerV1Global { } fn version(&self) -> u32 { - 1 + 2 } }