UpdateDevice() can be called at an arbitrary rate, so we need to
pace ourselves to avoid filling up the rumble queue with these.
(cherry picked from commit 6ec8b1a173)
Modern kernels (v5.8+) allow non-root usage of drmDropMaster(), so
we can hold on to our fd after dropping master on it. This fixes
populating drm_fd in the KMSDRM SysWMinfo when using Vulkan.
Also add a missing error check for open() while we're here.
This used a tiny stack, which apparently upsets Blender for various
technical reasons. Instead, just use the default stack size, which should
give it plenty of space to work.
If the thread failed to create, we would then wait on a semaphore that would
never trigger, so don't do that anymore!
Fixes#10806.
(cherry-picked from commit b7dc30ca24)
On most Unix platforms supported by SDL, the canonical name used to load
a library at runtime includes its ABI major version, and the name
without a version is not guaranteed to exist on non-developer systems.
libX11-xcb.so.1 is correct on Linux, and probably on other Unix
platforms like FreeBSD.
A notable exception is OpenBSD, which apparently does not use
ABI-suffixed names, so continue to use libX11-xcb.so there.
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 7713a7eec7)
We make sure we initialize XInput first, so that anything checking whether it's enabled gets a valid result based on whether we were able to load it or not.
(cherry picked from commit 8f46cb771c)
Send the fake warp coordinates when emulating warps with relative mode to ensure that it appears that the cursor is always reset to where the application expects it to be.
Fixes cases where games can continue moving the camera if the mouse is lifted during motion.
Cursor visibility in the SDL input layer only reflects whether ShowCursor/HideCursor was called. In the case of relative mode, the cursor can be hidden, but the SDL_Mouse visibility flag will be true.
Track cursor visibility separately in the X11 driver. Fixes the cursor becoming visible when using the warping relative mode with XWayland.
(cherry picked from commit b0713a7d30)
- Begining of device ID with 0 violates the SDL's specification that means the 0 is an error, invalid, failure, etc. But on Vita here it's an actual device...
- Replacing 0 and 1 with 1 and 2 to resolve this violation.
This prevents continuing a rumble after the first one fails, and fixes a long standing crash issue if rumble is started immediately before the controller is disconnected.
Thanks to @AntTheAlchemist for the key bug report that showed what was happening here.
Fixes https://github.com/libsdl-org/SDL/issues/10422
(cherry picked from commit 0a924b185d)
This restores the behaviour before 9221548114 where we only preventDefault the event if:
- the key is recognised
- the event is enabled
- the event is not filtered
(ignoring the KEYPRESS special case, which is unchanged)