From 91d42dc190ec522cb92bb596636027368e765637 Mon Sep 17 00:00:00 2001 From: may Date: Sun, 25 May 2025 18:54:28 +0200 Subject: [PATCH] wayland/cursor_shape: update to version 2 --- Cargo.toml | 2 +- src/seat/mod.rs | 2 +- src/seat/pointer/cursor_shape.rs | 6 ++++-- src/seat/pointer/mod.rs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 12909e73c..c064fdc41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] bitflags = "2.4" bytemuck = { version = "1.13.0", optional = true } -cursor-icon = "1.1.0" +cursor-icon = "1.2.0" libc = "0.2.148" log = "0.4" memmap2 = "0.9.0" diff --git a/src/seat/mod.rs b/src/seat/mod.rs index c84617add..065cd7ec2 100644 --- a/src/seat/mod.rs +++ b/src/seat/mod.rs @@ -250,7 +250,7 @@ impl SeatState { &self.cursor_shape_manager_state { self.cursor_shape_manager_state = - match crate::registry::bind_one(registry, &[global.clone()], qh, 1..=1, GlobalData) + match crate::registry::bind_one(registry, &[global.clone()], qh, 1..=2, GlobalData) { Ok(bound) => { CursorShapeManagerState::Bound(CursorShapeManager::from_existing(bound)) diff --git a/src/seat/pointer/cursor_shape.rs b/src/seat/pointer/cursor_shape.rs index d6129745a..1d1821012 100644 --- a/src/seat/pointer/cursor_shape.rs +++ b/src/seat/pointer/cursor_shape.rs @@ -21,7 +21,7 @@ impl CursorShapeManager { where State: Dispatch + 'static, { - let cursor_shape_manager = globals.bind(queue_handle, 1..=1, GlobalData)?; + let cursor_shape_manager = globals.bind(queue_handle, 1..=2, GlobalData)?; Ok(Self { cursor_shape_manager }) } @@ -77,7 +77,7 @@ where } } -pub(crate) fn cursor_icon_to_shape(cursor_icon: CursorIcon) -> Shape { +pub(crate) fn cursor_icon_to_shape(cursor_icon: CursorIcon, version: u32) -> Shape { match cursor_icon { CursorIcon::Default => Shape::Default, CursorIcon::ContextMenu => Shape::ContextMenu, @@ -113,6 +113,8 @@ pub(crate) fn cursor_icon_to_shape(cursor_icon: CursorIcon) -> Shape { CursorIcon::AllScroll => Shape::AllScroll, CursorIcon::ZoomIn => Shape::ZoomIn, CursorIcon::ZoomOut => Shape::ZoomOut, + CursorIcon::DndAsk if version >= 2 => Shape::DndAsk, + CursorIcon::AllResize if version >= 2 => Shape::AllResize, _ => Shape::Default, } } diff --git a/src/seat/pointer/mod.rs b/src/seat/pointer/mod.rs index 76e0f0335..4131be176 100644 --- a/src/seat/pointer/mod.rs +++ b/src/seat/pointer/mod.rs @@ -440,7 +440,7 @@ impl ThemedPointer