The structure of the existing loop makes the inner loop of the previous commit unnecessary.
Manual backport of 558630d59c
(cherry picked from commit 62f35ab1b6)
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)
(cherry picked from commit 7fdf794377)
This prevents race conditions and divide by zero if multiple threads start using the time functions simultaneously.
(cherry picked from commit b378bc5c83)
This commit fixes the attribute list in the WGL and GLX code when requesting a floating point pixel format. The name of the attribute was missing in the list.
Fixes libsdl-org#10189
(cherry picked from commit 9389712917)
(cherry picked from commit 58e179c8b5)
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)
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)