Wayland: Fix cursor offset when shape changes

The Wayland protocol spec[1] states that set_cursor must be called
with the serial number of the enter event.  However, GLFW is passing in
the serial number of the latest received event, which does not meet the
protocol spec.

[1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_pointer

As a result, set_cursor calls were simply ignored by the compositor.

This fix complies with the protocol more closely by specifically caching
the enter event serial, and using it for all set_cursor calls.

Fixes #1706
Closes #1899

(cherry picked from commit e7758c506d)
This commit is contained in:
Waris Boonyasiriwat
2021-05-12 00:30:14 -07:00
committed by Camilla Löwy
parent 33ff23dc07
commit 6bb5f5d59d
4 changed files with 9 additions and 5 deletions
+1
View File
@@ -252,6 +252,7 @@ typedef struct _GLFWlibraryWayland
const char* cursorPreviousName;
int cursorTimerfd;
uint32_t serial;
uint32_t pointerEnterSerial;
int32_t keyboardRepeatRate;
int32_t keyboardRepeatDelay;