From 37aef0c01567e8c82d8850b40b08115475ff68f6 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 9 May 2023 20:53:51 +0300 Subject: [PATCH] Take cursor surface offset into account From the spec On surface.attach requests to the pointer surface, hotspot_x and hotspot_y are decremented by the x and y parameters passed to the request. Attach must be confirmed by wl_surface.commit as usual. In practice, I don't think it matters that much as most toolkits use wl_pointer.set_cursor to change the hotspot. --- src/cursorsource.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cursorsource.cpp b/src/cursorsource.cpp index 50dcc8fc1b..4c8497d9f5 100644 --- a/src/cursorsource.cpp +++ b/src/cursorsource.cpp @@ -124,6 +124,7 @@ KWaylandServer::SurfaceInterface *SurfaceCursorSource::surface() const void SurfaceCursorSource::refresh() { m_size = m_surface->size(); + m_hotspot -= m_surface->offset(); Q_EMIT changed(); }