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.
This commit is contained in:
Jonas Ådahl 2022-11-16 17:01:02 +01:00 committed by akallabeth
parent b2cf6f5c2c
commit 5b09cd57a7

View File

@ -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);
}