Commit graph

22083 commits

Author SHA1 Message Date
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
Sam Lantinga
f6ffa69890 Add support for new Steam Controller input report on mobile devices 2026-05-28 11:39:58 -07:00
Sam Lantinga
a95f5f9874 testcontroller: make sure touchpad touches are visible even at very light pressure 2026-05-28 09:58:33 -07:00
Sam Lantinga
bb3c61390a Fix mistyped output report message for Steam Controller
This caused hiccups in BlueZ BT driver for Linux
2026-05-27 18:20:17 -07:00
Sam Lantinga
f7a8801227 Add support for new Steam Controller input report 2026-05-27 18:19:43 -07:00
Rachel Blackman
a7ecd5f777 OpenVR: Actually quit correctly if we get a close/quit message. 2026-05-27 17:40:30 -07:00
SDL Wiki Bot
8c0add4351 Sync SDL3 wiki -> header
[ci skip]
2026-05-27 23:36:18 +00:00
Evan Hemsley
7911975414
GPU: Clarify some presentation concerns in docs (#15707) 2026-05-27 16:34:48 -07:00
Sam Lantinga
76560f9e47 Revert "android: fixed a possible joystick-related deadlock on application termination"
This reverts commit 6b4ae68460.

It turns out this deadlock is possible for any joystick event delivery combined with an event watcher that locks joysticks. I'm reverting this change for now, and will be working on a better global solution for this problem.
2026-05-27 13:07:46 -07:00
Ryan C. Gordon
c568c46f51 cmake: Preseed the CMake cache for Haiku OS.
This change drops the configure time on my little Haiku virtual machine from
103 seconds to six.  :)

Fixes #15702.
2026-05-27 15:43:16 -04:00
Ryan C. Gordon
d7ba3efe6b
filesystem: Implement SDL_GetExeName() for all platforms. 2026-05-27 15:41:51 -04:00