Commit Graph

22093 Commits

Author SHA1 Message Date
Sam Lantinga
f7a0ab3bbf Fixed ABBA deadlock on Android
This fixes a deadlock when a call comes in from Java that takes the activity lock and then tries to send an event, which takes the event lock, at the same time the application thread takes the event lock and then calls SDL_RequestAndroidPermission(), which takes the activity lock.

Fixes https://github.com/libsdl-org/SDL/issues/15772
Fixes https://github.com/libsdl-org/SDL/issues/15771
2026-06-08 09:16:51 -07:00
SDL Wiki Bot
c91c5c7d85 Sync SDL3 wiki -> header
[ci skip]
2026-06-08 16:02:29 +00:00
Frank Praznik
96919c37c9 stdlib: Add SDL_wcstoul(), SDL_wcstoll(), and SDL_wcstoull()
Includes the appropriate stdlib checks and automated tests.
2026-06-08 11:58:47 -04:00
Ozkan Sezer
b53f1b0644 update vulkan headers from khronos. 2026-06-07 02:10:50 +03:00
Sylvain
72d14c281c Fixed bug #13850: SDLControllerManager, we can use isVirtual() since API > 16 2026-06-06 07:58:47 -07:00
COMRADECHOnKy
6bccbd6b1f SDL_GetRenderOutputSize -> SDL_GetCurrentRenderOutputSIze
SDL_GetRenderOutput size is old
2026-06-06 07:57:24 -07:00
Sam Lantinga
55908f14f8 Added SDL_aligned_alloc_zero() 2026-06-05 13:55:32 -07:00
Sam Lantinga
fa2a726cc3 Added SDL_CreateSurfaceUninitialized()
Currently this is an internal API, but we can expose it in the future.
2026-06-05 09:14:07 -07:00
Nintorch
2fd15d9e0d Add mappings for NES Switch controllers on Linux 2026-06-05 08:56:15 -07:00
Anonymous Maarten
1bf6279fc7 ci: ignore artifact upload errors 2026-06-05 03:17:42 +02:00
Zizin13
7341f04a12 Fix DirectInput POV handling for devices with extra hats 2026-06-04 12:23:33 -07:00
Sam Lantinga
8549aae829 Make initializeDeviceListener() and shutdownDeviceListener() public 2026-06-04 09:26:33 -07:00
Sam Lantinga
36c5809b09 Added SDLControllerManager::shutdownDeviceListener() 2026-06-04 09:19:53 -07:00
Sam Lantinga
e5bbef0dbc Fixed detecting PS4 controllers on Android 2026-06-04 09:19:28 -07:00
Thad House
0c8feecce6 Enable extra player LED sets for PS5 Controllers 2026-06-04 08:05:29 -07:00
Sylvain Becker
fc3a96e47a Android: remove pollInputDevice() in favor of InputDeviceListener (#15659) 2026-06-03 20:38:04 -07:00
Sam Lantinga
42fc082b5e Fixed java.lang.NullPointerException
From @AntTheAlchemist:
This is an interesting one, on a Xiaomi MiTV. Caused by a camera device, full stack:
android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args -> org.libsdl.app.HIDDeviceManager$1.onReceive -> handleUsbDeviceAttached -> connectHIDDeviceUSB -> getSerialNumber -> android.hardware.usb.UsbDevice.getSerialNumber -> android.hardware.usb.IUsbSerialReader$Stub.onTransact -> com.android.server.usb.UsbSerialReader.getSerial -> UsbUserPermissionManager.checkPermission -> hasPermission -> isCameraDevicePresent
2026-06-02 16:51:58 -07:00
Sam Lantinga
64def01534 Fixed some Wayland cursor related thread-safety warnings 2026-06-02 16:51:58 -07:00
Sam Lantinga
90756b542f Fixed some log related thread-safety warnings 2026-06-02 16:51:58 -07:00
Sam Lantinga
f9d49358d2 Create a global event lock for hardware that generates events
This prevents ABBA deadlocks caused by taking a hardware resource lock then delivering events at the same time another thread is taking a hardware resource lock from an event watch callback.

Fixes https://github.com/libsdl-org/SDL/issues/15709
2026-06-02 16:51:58 -07:00
Sam Lantinga
75270a4264 Handle java.util.ConcurrentModificationException while unregistering sensor listeners
We're still seeing this frequently when unregistering PlayStation controller sensors. We don't know what else is modifying the sensor list, but if we end up getting this exception we'll retry after a short sleep.
2026-06-02 16:51:58 -07:00
Ryan C. Gordon
49a4c07e23 examples/input/05-gamepad-rumble: add some visual feedback. 2026-06-02 19:50:05 -04:00
Ryan C. Gordon
dc34abc03e pipewire: Add SDL_HINT_AUDIO_DEVICE_STREAM_NAME callback earlier.
Otherwise, it might cause a deadlock, if the output_callback runs in another
thread while the guaranteed initial hint callback fires. One will wait for the
SDL device lock, the other the pipewire thread loop lock, each already holding
what the other needs.

This way, the hint callback fires and we ignore it, since the stream isn't
set up yet...which is good, because we're about to create the stream and set
that exact same state on it directly anyhow. Now there's no chance of this
deadlock happening.

Reference Issue #15075.
2026-06-02 19:04:28 -04:00
Sam Lantinga
5ede4fbd08 Revert "vfork() isn't functional on DOS"
This reverts commit 91173aba25.

As @icculus mentioned: I'd rather we not get into the business of making fixes by tweaking values in the Preseed files. Were there no preseed file, CMake would correctly record that the vfork function exists, so if we're really hitting the vfork() codepath on DOS, we should stop that in either CMakeLists.txt itself, or in src/process.
2026-06-02 14:16:31 -07:00
Sam Lantinga
91173aba25 vfork() isn't functional on DOS 2026-06-02 12:23:14 -07:00
Simon McVittie
d834351d69 workflows: Stop building for Steam Runtime 3 on arm64
The experimental Steam Linux Runtime 3.0 (arm64) container is being
phased out, so games that want native arm64 binaries should upgrade to
Steam Linux Runtime 4.0.

steamrt/tasks#1032

Signed-off-by: Simon McVittie <smcv@collabora.com>
2026-06-02 12:21:45 -07:00
Ryan C. Gordon
18b29bdd58 PreseedDOSCache.cmake: Add vfork check.
(djgpp actually has this symbol, believe it or not. Not sure what it could
possibly do, but it says it has it!)
2026-06-02 11:25:30 -04:00
Sam Lantinga
cadd67007c Removed k_eControllerType_AndroidController and k_eControllerType_AppleController 2026-06-01 17:55:54 -07:00
Nintorch
96c03dc66e Fix web joystick vibration (again) 2026-05-31 14:13:07 -07:00
Sam Lantinga
dc8b189491 examples: Added input/05-gamepad-rumble 2026-05-31 08:32:44 -07:00
Nintorch
e0eb40f65f Fix web joystick vibration on Safari 2026-05-31 08:04:45 -07:00
SDL Wiki Bot
38e7155cd6 Sync SDL3 wiki -> header
[ci skip]
2026-05-31 02:51:28 +00:00
Ryan C. Gordon
098a066f20 docs: Update documentation for SDL_stack_free.
Reference Issue #15727.
2026-05-30 22:49:38 -04:00
Ryan C. Gordon
67e6f5b7ee stdinc: make SDL_stack_free evaluate to ((void)(data)) when alloca is usable.
Fixes #15727.
2026-05-30 22:45:33 -04:00
Cameron Gutman
189877b1d3 joystick: Fix conflicting rumble and LED on Sony PS4 gamepads 2026-05-30 17:20:52 -07:00
Ryan C. Gordon
e1aaebff87 SDL_migration.cocci: Add joystick/gamepad event state functions. 2026-05-30 14:05:45 -04:00
Ryan C. Gordon
0cf06bf131 SDL_migration.cocci: add SDL_JoystickGetGUIDString -> SDL_GUIDToString. 2026-05-30 13:49:46 -04:00
Anonymous Maarten
dd0536b170 stdinc: only use _Countof for SDL_arraysize when using a C standard > C23 2026-05-30 13:39:01 +02:00
Vicki Pfau
687a59f277 joystick: Fix underflow with 0 delta timestamp
Some sensors will occasionally report two identical timestamps in a row.
This leads to the timestamp wrapping calculation to underflow, subtracting
0x80000000 from the timestamp whenever it happens. By adjusting the wrap
test, we can just directly add zero to the timestamp, fixing the underflow.
2026-05-29 21:47:50 -07:00
Ryan C. Gordon
9c2f143ca3 wikiheaders: Fix manpages for APIs that return a pointer to a const object.
Previously something like SDL_GetCurrentDisplayMode() would have this output:

```
RETURN VALUE
       *) Returns a pointer to the desktop display mode or NULL on failure; call SDL_GetError() for more information.
```

Now it doesn't have the junk at the start of the text:

```
RETURN VALUE
       Returns a pointer to the desktop display mode or NULL on failure; call SDL_GetError() for more information.

```
2026-05-29 21:10:37 -04:00
replicacoil
c43ab978fd Added rumble to Gamecube Adapter PC_Mode (#15431) 2026-05-29 17:28:47 -07:00
Sam Lantinga
2b0df96f25 Send SDL_EVENT_WINDOW_EXPOSED when the GPU renderer swap chain is resized
In this case the current frame being rendered doesn't match the swapchain size and the application should re-render the frame.

Fixes https://github.com/libsdl-org/SDL/issues/15550
2026-05-29 14:37:32 -07:00
Sam Lantinga
e04bfb4c6e render: an empty clip rect should clip all drawing
Added a test to validate this and fixed the Metal renderer

Fixes https://github.com/libsdl-org/SDL/issues/15434
2026-05-29 13:58:34 -07:00
NY00123
ed2c8036a7 Android: Remove unused accelerometer-related code and definitions
That also covers removal of the call `SDLActivity.onNativeAccel`,
plus a change of comment under SDL_android.c.

Definitions were previously used while an accelerometer could be listed as a joystick.
2026-05-29 13:14:09 -07:00
Sam Lantinga
8a701808a6 Fixed Steam Controller not detected on macOS under Steam 2026-05-29 12:07:16 -07:00
Sam Lantinga
ec0066aa0b Fixed detecting the Steam virtual gamepad when HIDAPI is disabled 2026-05-29 10:55:57 -07:00
Sam Lantinga
ed6e03436e Added HIDAPI support for the PDP Afterglow Wave Wireless Controller for Switch 2026-05-29 09:56:15 -07:00
Sam Lantinga
634dff3725 Added DEBUG_STEAM_PROTOCOL for the new Steam Controller 2026-05-28 19:51:34 -07:00
Sam Lantinga
113e97e193 metal: fixed reading textures with format SDL_PIXELFORMAT_RGBA128_FLOAT 2026-05-28 11:50:03 -07:00
Sam Lantinga
7103ed4167 Fixed Steam Controller rumble on Android (thanks @Packetdancer!) 2026-05-28 11:39:58 -07:00