From 68a7c06b9ee4427f88865402afb0be823862ae82 Mon Sep 17 00:00:00 2001 From: Nova Date: Sun, 27 Apr 2025 11:06:55 -0700 Subject: [PATCH] fix: cursor hotspot positionind --- src/wayland/seat.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wayland/seat.rs b/src/wayland/seat.rs index bbe3d6a..b525f33 100644 --- a/src/wayland/seat.rs +++ b/src/wayland/seat.rs @@ -13,7 +13,7 @@ use smithay::{ input::{ Seat, SeatHandler, keyboard::{FilterResult, LedState}, - pointer::{AxisFrame, ButtonEvent, CursorImageStatus, MotionEvent}, + pointer::{AxisFrame, ButtonEvent, CursorImageStatus, CursorImageSurfaceData, MotionEvent}, touch::{self, DownEvent, UpEvent}, }, reexports::wayland_server::{Resource, Weak as WlWeak, protocol::wl_surface::WlSurface}, @@ -38,6 +38,11 @@ impl SeatHandler for WaylandState { CursorImageStatus::Surface(surface) => { CoreSurface::add_to(&surface); compositor::with_states(&surface, |data| { + if let Some(cursor_attributes) = data.data_map.get::() { + let hotspot = cursor_attributes.lock().unwrap().hotspot; + c.hotspot_x = hotspot.x; + c.hotspot_y = hotspot.y; + } if let Some(core_surface) = data.data_map.get::>() { core_surface.set_material_offset(1); }