Skip to content

Commit 91d42dc

Browse files
committed
wayland/cursor_shape: update to version 2
1 parent 0eba37b commit 91d42dc

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1919
[dependencies]
2020
bitflags = "2.4"
2121
bytemuck = { version = "1.13.0", optional = true }
22-
cursor-icon = "1.1.0"
22+
cursor-icon = "1.2.0"
2323
libc = "0.2.148"
2424
log = "0.4"
2525
memmap2 = "0.9.0"

src/seat/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl SeatState {
250250
&self.cursor_shape_manager_state
251251
{
252252
self.cursor_shape_manager_state =
253-
match crate::registry::bind_one(registry, &[global.clone()], qh, 1..=1, GlobalData)
253+
match crate::registry::bind_one(registry, &[global.clone()], qh, 1..=2, GlobalData)
254254
{
255255
Ok(bound) => {
256256
CursorShapeManagerState::Bound(CursorShapeManager::from_existing(bound))

src/seat/pointer/cursor_shape.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl CursorShapeManager {
2121
where
2222
State: Dispatch<WpCursorShapeManagerV1, GlobalData> + 'static,
2323
{
24-
let cursor_shape_manager = globals.bind(queue_handle, 1..=1, GlobalData)?;
24+
let cursor_shape_manager = globals.bind(queue_handle, 1..=2, GlobalData)?;
2525
Ok(Self { cursor_shape_manager })
2626
}
2727

@@ -77,7 +77,7 @@ where
7777
}
7878
}
7979

80-
pub(crate) fn cursor_icon_to_shape(cursor_icon: CursorIcon) -> Shape {
80+
pub(crate) fn cursor_icon_to_shape(cursor_icon: CursorIcon, version: u32) -> Shape {
8181
match cursor_icon {
8282
CursorIcon::Default => Shape::Default,
8383
CursorIcon::ContextMenu => Shape::ContextMenu,
@@ -113,6 +113,8 @@ pub(crate) fn cursor_icon_to_shape(cursor_icon: CursorIcon) -> Shape {
113113
CursorIcon::AllScroll => Shape::AllScroll,
114114
CursorIcon::ZoomIn => Shape::ZoomIn,
115115
CursorIcon::ZoomOut => Shape::ZoomOut,
116+
CursorIcon::DndAsk if version >= 2 => Shape::DndAsk,
117+
CursorIcon::AllResize if version >= 2 => Shape::AllResize,
116118
_ => Shape::Default,
117119
}
118120
}

src/seat/pointer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ impl<U: PointerDataExt + 'static, S: SurfaceDataExt + 'static> ThemedPointer<U,
440440
};
441441

442442
if let Some(shape_device) = self.shape_device.as_ref() {
443-
shape_device.set_shape(serial, cursor_icon_to_shape(icon));
443+
shape_device.set_shape(serial, cursor_icon_to_shape(icon, shape_device.version()));
444444
Ok(())
445445
} else {
446446
self.set_cursor_legacy(conn, serial, icon)

0 commit comments

Comments
 (0)