| Summary: | SDL_SetRelativeMouseMode closes application on Wayland | ||
|---|---|---|---|
| Product: | SDL | Reporter: | M Stoeckl <sdlbug> |
| 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: |
Test program; runs until keypress (or until SDL_RelativeMouseMode called)
Test program output, with env WAYLAND_DEBUG=1 Interactive version of test program with two windows Patch: do not simultaneously lock and confine pointer Patch #2: wayland, Clean up dangling pointers when destroying window Interactive version of test program |
||
|
Description
M Stoeckl
2020-07-18 00:59:41 UTC
Created attachment 4420 [details]
Test program; runs until keypress (or until SDL_RelativeMouseMode called)
Created attachment 4421 [details]
Test program output, with env WAYLAND_DEBUG=1
Created attachment 4429 [details]
Interactive version of test program with two windows
Created attachment 4430 [details]
Patch: do not simultaneously lock and confine pointer
I've attached a patch that possibly fixes this issue, by keeping the pointer confinement disabled (not created) as long as there is a conflicting pointer lock. In the process of creating the patch, I discovered that SDL_WaylandInput::pointer_focus and SDL_WaylandInput::keyboard_focus are never explicitly cleaned up by the Wayland backend. I don't have enough time right now to track down whether or not SDL_video.c guarantees that these are cleared before the object in memory being pointed to is destroyed. In the patch, I introduced a similar variable SDL_WaylandInput::confined_window, about whose cleanup I am similarly uncertain. See also the TODO comment. Created attachment 4432 [details]
Patch #2: wayland, Clean up dangling pointers when destroying window
Created attachment 4433 [details]
Interactive version of test program
OK, Patch #2 now fixes the TODO comment. Fixed as of 2.0.14. |