From 5b09cd57a7ecd2bd588a3edd784081796c96e324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 16 Nov 2022 17:01:02 +0100 Subject: [PATCH] uwac/input: Don't pass hotspot as offset when attaching cursor buffer Passing a non-zero offset to cursor buffer and then calling wl_pointer.set_cursor doesn't make much sense, as any offset will immediately be reset. The protocol specifies the cursor set by wl_pointer.set_cursor to be > The parameters hotspot_x and hotspot_y define the position of > the pointer surface relative to the pointer location. Its > top-left corner is always at (x, y) - (hotspot_x, hotspot_y), > where (x, y) are the coordinates of the pointer location, in > surface-local coordinates. This leaves no room available for any previously set offsets to be kept in response to wl_pointer.set_cursor. --- uwac/libuwac/uwac-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index d0f3ada9f..5a103f9a6 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -134,7 +134,7 @@ static UwacReturnCode set_cursor_image(UwacSeat* seat, uint32_t serial) if (surface && buffer) { - wl_surface_attach(surface, buffer, -x, -y); + wl_surface_attach(surface, buffer, 0, 0); wl_surface_damage(surface, 0, 0, image->width, image->height); wl_surface_commit(surface); }