Add a loop around SDL_hid_read() in the Steam Deck HIDAPI driver as it
is done in other HIDAPI drivers. This loop reads data from the device and
processes it until the input buffer is empty which ensures that clients
always get the latest data.
This fixes an input latency issue if the application polls the events
slower than the hardware generates them.
(cherry picked from commit 22770e6496)
The CRC is used to distinguish between different controllers that have the same VID/PID, so if the CRC doesn't match, it's probably a different controller that we don't know about.
Fixes https://github.com/libsdl-org/SDL/issues/9265
(cherry picked from commit 30e93b40c2)
(cherry picked from commit b8daf14fe5)
This changes the `SDL_EVENTS_DISABLED` path's return value from SDL_DISABLE
to SDL_IGNORE to match expectations, but doesn't actually change the ABI,
since these two symbols are both zero.
Fixes https://github.com/libsdl-org/sdlwiki/issues/460
(cherry picked from commit 7d60ff9965)
On Android, HIDAPI prompts for permissions and acquires exclusive access to the device, and on Apple mobile platforms it doesn't do anything except for handling Bluetooth Steam Controllers.
Fixes https://github.com/libsdl-org/SDL/issues/9241
(cherry picked from commit e3cf2e4794)
(cherry picked from commit 66054a6515)
Steam ran into a crash SDL_XINPUT_JoystickDetect() with XINPUTGETCAPABILITIES being NULL. I'm not sure how that happened, and there may still be a race condition if this is a multi-threaded issue, but at least this is more correct.
(cherry picked from commit 0ae4fd0ec9)
(cherry picked from commit ee3b2b7de1)
The display deletion code would not free the driver data or name if the display index was the last, or only one, in the list.
(cherry picked from commit 20f1061cc8)
In the stdcpp thread implementation, the allocated std::thread objects were never deleted after joining/detaching
(cherry picked from commit 20dbe90771)
(cherry picked from commit 99d7b9e626)
When loading libraries the `SDL.mContext` is still `null`. This results in
relinker code path in `SDL.loadLibrary(...)` always throwing a null exception
and fallbacking to system loader.
Fix it by passing the context explicitly.
(cherry picked from commit 6a2dd96ac7)
Proton uses this on Linux to determine what the XInput slot is for the gamepad. Other applications will get the real controller name and VID/PID by virtue of the code in SDL_steam_virtual_gamepad.c
(cherry picked from commit 361cae0874)
(cherry picked from commit a6fdd155fb)
The former will respect user orientation lock setting while the latter does not.
(cherry picked from commit 3373667faa)
(cherry picked from commit 77285b6c3f)
avoids -Wformat warnings from mingw toolchains -- e.g.:
src/test/SDL_test_harness.c:581:37: warning: unknown conversion type character 'l' in format [-Wformat=]
(cherry picked from commit 49b6c24722)
(cherry picked from commit 863670c0a8)
When they are in simple report mode, the thumbstick gets turned into a digital hat, so let's use them in full report mode.
(cherry picked from commit bf27269952)
(cherry picked from commit 169f77ed5e)
Libdecor windows will have this done during the first frame configure, but bare xdg-toplevel windows need it set explicitly, or a non-resizable window might be able to be resized.
(cherry picked from commit fc6bbde525)
Also added the Logitech Chillstream to the list of PS3 controllers and fixed the right shoulder axis.
(cherry picked from commit b6d7adfec1)
(cherry picked from commit f520062ad1)
Custom theme file exists in project, but is not used by app, which is kinda unintuitive. Using it by default so people who not familiar with Android development won't spend lots of time troubleshooting.
(cherry picked from commit 8f88c32ca6)
(cherry picked from commit 1568501dd6)