| Summary: | Wayland: SDL ignores initial pointer position | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Tudor <me> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | Attempt #1 | ||
Looks good, thanks! https://hg.libsdl.org/SDL/rev/a9b4bd264f3c |
Created attachment 4352 [details] Attempt #1 A Wayland compositor may send a `pointer_enter` event with the coordinates of the pointer, followed by no (immediate) `pointer_motion` event. A simple case where this can happen is when a pointer confine is created: the compositor will warp the cursor to the SDL surface and emit a `pointer_enter` event, but no `pointer_motion`. Since SDL only updates its internal position state on `pointer_motion`, this can lead to confusing results where the hardware cursor does not match where an SDL application thinks the cursor is. I've attached a patch that addresses this issue, by treating `pointer_enter` as a "special" `pointer_motion` event.