Commit Graph

22114 Commits

Author SHA1 Message Date
Frank Praznik
ba7c0b897b Add the Cocoa notification driver
Supported on macOS 10.14+ and iOS.
2026-06-10 13:25:38 -04:00
Frank Praznik
984b03680f Add the Windows notification driver
Notifications are supported on Win10 and above.
2026-06-10 13:25:38 -04:00
Frank Praznik
8275f6e90d Add D-Bus notification driver
Use the core and portal notification implementations to dispatch system notifications.
2026-06-10 13:25:38 -04:00
Frank Praznik
068e405912 Add notification framework with test and dummy driver 2026-06-10 13:25:38 -04:00
Anonymous Maarten
513b5d067d ci: run GDK on older Windows environment
>
> The GDK version which is set up by build-scripts/setup-gdk-desktop.py does not support Visual Studio 2026
2026-06-10 18:44:23 +02:00
expikr
ed43ec0277 don't fetch timestamp again 2026-06-10 06:26:52 -07:00
Alejandro Perez
14b0e9d922 Add Corsair as valid PS controller 2026-06-09 19:49:20 -07:00
Ryan C. Gordon
6136358840 audio: Split device "zombie" status into multiple stages.
Otherwise, a device that is disconnected in the standard audio device thread
might keep failing WaitDevice() in a tight loop, each one generating a new
main thread callback. In normal situations, this is wasteful, but if the
app isn't pumping the event loop quickly (or at all!), this will quickly eat
up all the memory in a machine.

Now we note that the device is zombified right away, and device thread
iteration will use this to replace the implementation with the Zombie
equivalents once it owns the device lock.

The main thread callback will progress to device->zombie==2, which it uses to
decide if this is a duplicate disconnect notification. Since it also owns the
lock at this point, it takes the moment to set the Zombie implementation up,
too.

This allows things (like the WASAPI backend) to check for a non-zero zombie
state immediately without having to worry if the main thread callback ran, and
for the standard audio threads to also move to the Zombie implementation
without waiting on that callback.

(The Zombie implementation is used to make a dead device keep processing, so
things that need the audio device to make progress to function will keep
working, and things blindly pushing to an audio stream won't queue up endless
data that isn't being consumed.)

Fixes #15745.
2026-06-09 20:25:49 -04:00
Sam Lantinga
64998d2bc8 Fixed a hang reading the Xbox report descriptor on macOS 2026-06-09 11:12:52 -07:00
Sam Lantinga
c62cc657a2 Fixed the Xbox 360 Controller showing as a Steam Virtual Gamepad on macOS 2026-06-09 10:33:51 -07:00
QwertyChouskie
157c839139 SDL_hidapi_xbox360.c: Fix Y axis inversion on macOS (#15792)
Originally, macOS had opposite Y axis inversion as every other platform, likely to correct for an issue with the virtual gamepad reported by the old 360Controller driver.

Wired Xbox 360 controllers using native macOS drivers were first reported to be broken in https://github.com/libsdl-org/SDL/issues/11002.  The inversion was removed in 7da728a642, presumably breaking 360Controller usage, but fixing wired 360 controller using the new native support in macOS 15 and above.  However, this change was reverted without explanation in d7b1ba1bfc which added explicit support for the Steam Virtual Gamepad.  Presumably, Steam on macOS reports inverted Y axes to match what SDL expected on the platform.  However, this reversion broke the native macOS controller support.  The incorrect inversion also breaks using off-brand 360-class gamepads via the libusb backend of HIDRAW.
2026-06-09 10:12:45 -07:00
QwertyChouskie
0bd95b0430 Respect SDL_HINT_JOYSTICK_MFI 2026-06-09 07:33:22 -07:00
Sylvain
9986c89da0 Android: prevent removing joystick if SDL hasn't been initialized yet 2026-06-09 05:55:00 -07:00
Sanjay Govind
3f80c0b82a Add GIP vids and pids for stage tour instruments (#15788) 2026-06-08 22:08:10 -07:00
Ryan C. Gordon
43e8e01ce9 dos: Fixed some mistakes in cmake/PreseedDOSCache.cmake 2026-06-09 00:54:46 -04:00
Sam Lantinga
47403eccd2 Fixed the Xbox 360 wireless adapter showing up as a controller 2026-06-08 21:31:20 -07:00
Sanjay Govind
205777210e Add PID for red octane games, as they support sony detection 2026-06-08 20:20:49 -07:00
Ryan C. Gordon
de51952c2e dos: Fixed a comment typo 2026-06-08 22:35:16 -04:00
Sam Lantinga
bef72ab488 Don't treat the IR receiver on the NVIDIA Shield TV as a joystick 2026-06-08 14:45:26 -07:00
Sam Lantinga
acc06bce35 android: fixed crash adding joysticks before joysticks are initialized
Fixes https://github.com/libsdl-org/SDL/issues/15777
2026-06-08 14:35:42 -07:00
Sam Lantinga
63a322cdd1 android: fixed ANR if we lose focus at startup
If we lose focus during startup, we need to unlock the activity mutex before waiting for the focus lifecycle event, otherwise it will never be delivered.

Reproduced using testcontroller with a DualSense controller attached and the "Allow the app to access the USB device?" dialog popped up.
2026-06-08 13:51:12 -07:00
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