Commit Graph
13304 Commits
Author SHA1 Message Date
Sam Lantinga ffc7381337 Only skip the Flydigi driver when checking to see if a device is handled by HIDAPI
(cherry picked from commit cf6a235a41)
2026-07-07 09:30:49 -07:00
Isabella Basso 27e6b7a119 cocoa: restore discrete mouse wheel ticks
(cherry picked from commit 1f3f714393)
2026-07-07 11:08:20 -04:00
Sam Lantinga b18591f4a0 Fixed the 8BitDo Pro 3 controller showing up twice on macOS
Fixes https://github.com/libsdl-org/SDL/issues/15890

(cherry picked from commit 03f81ab4aa)
2026-07-06 17:04:42 -07:00
8BitDo 1ac361c3fe support 8bitdo ultimate 3 (#15927)
(cherry picked from commit efa0e2d5ed)
2026-07-06 05:51:06 -07:00
Caleb Cornett 6c10cdb6eb gpu: Metal fence fixes
(cherry picked from commit 3561f81400)
2026-07-06 05:44:50 -07:00
Alex Tselousov 7e593a2b4f Removed busyloop from SDL_GPUFence on MacOS
Before, MetalFence was implemented as simply a busy loop on an atomic
int on metal, meaning the cpu would busy wait on the gpu to finish
taking power from it and decreasing battery life. This was the only kind
of cpu-gpu syncing (apart from requesting a swapchain)

(cherry picked from commit 514b26e4c4)
2026-07-06 05:44:50 -07:00
Jacul a19040c84d metal: check MTLBuffer allocations for nil before using their contents.
(cherry picked from commit e1b3c8afd5)
2026-07-06 05:44:20 -07:00
Dimitriy Ryazantcev 1cb193a414 Win32: Swap maskColor assignment based on alpha value
Looks like mask pixels was inverted.

(cherry picked from commit 362165ed9b)
2026-07-05 12:37:46 -07:00
Tim Stahlhut 64f058d050 Use SDL_PROCESS_WINDOWS instead of SDL_PLATFORM_WINDOWS
in SDL_process.c

[sdl-ci-filter cygwin]
[sdl-ci-filter msys2-*]
[sdl-ci-filter msvc-*]

(cherry picked from commit 655c8166a1)
2026-07-04 11:19:44 -07:00
Zana Domán 81c39b0cc5 gpu: validate transfer buffer usage (#15923)
(cherry picked from commit 095e899973)
2026-07-03 17:11:54 -07:00
Sam Lantinga 932f36590f Updated to version 3.4.13 for development 2026-07-01 09:55:50 -07:00
Sam Lantinga f87239e71e Updated to version 3.4.12 for release 2026-07-01 09:20:42 -07:00
Ryan C. Gordon 39aff4c978 audio: Pass the id, not the obj, to SDL_AudioDeviceDisconnected_OnMainThread.
If a device has disconnected, and the app has quit the audio subsystem before
the queued main thread function has run, the pointer will be bogus by the time
the run occurs. So now it looks up the object from its device ID, and if the
lookup returns NULL, it returns immediately and everything works out.

Reference Issue #14856.

(which might be fixed by this or not.)

(cherry picked from commit 774728b6ff)
2026-06-30 23:29:41 -04:00
Sam Lantinga 2d8ddf333a Get the physical device properties when using an external Vulkan device
Fixes `testffmpeg --sprites 100` when using the Vulkan renderer

(cherry picked from commit dfefce62e2)
2026-06-30 13:00:30 -07:00
Sam Lantinga f321b80e7a Issue a batch when changing render targets in the Vulkan renderer
Otherwise we get rendering artifacts that look like drawing is being applied to the wrong render target

(cherry picked from commit 464b90b475)
2026-06-30 09:01:05 -07:00
Frank Praznik 6f0544dcca wayland: Fix incorrect dereference when sorting icon surfaces
(cherry picked from commit 2f1cf4629c)
2026-06-30 10:16:28 -04:00
Mason Remaley 25e2ec0407 Fixes invalid dereference in animated cursor sort
`Wayland_CreateAnimatedCursor` calls `SDL_qsort` on an array of
type `**SDL_Surface`, not on an array of `*SDL_Surface`. As such the void
pointers in the callback need to be casted to `SDL_Surface **` not
`SDL_Surface *`.

This was likely not caught since it's very unlikely that reading a few
bytes past the end of this array results in reading unreadable memory,
so the only side effect was invalid sort results, which is a bit subtle.

I caught this because I build SDL with UBSAN enabled in my debug builds,
and it trapped when the multiplication of the garbage `SDL_Surface*`
width and heights overflowed. I validated that the change is correct by
adding logs (that have then since been removed) demonstrating that it
was previously comparing garbage, and is now comparing the actual cursor
surfaces.

(cherry picked from commit a168e96cbc)
2026-06-30 09:54:32 -04:00
Sam Lantinga 13a2ea7187 Added a workaround for a crash in NVIDIA drivers when rendering YUV with Vulkan
Fixes https://github.com/libsdl-org/SDL/issues/13878

(cherry picked from commit e0b12bbcea)
2026-06-29 14:18:18 -07:00
Frank Praznik 2ccd76818e win32: Use the current cursor coordinates when processing WM_NCACTIVATE
The event coordinates returned by GetMessagePos() for WM_NCACTIVATE are out of date if the cursor moved while an overlay was active, and may indicate that the cursor is still in the window when it is not. Always use the current cursor coordinates when processing this message to avoid incorrectly setting mouse focus if the cursor is no longer within the window.

(cherry picked from commit 0a8ccb11eb)
2026-06-29 12:39:36 -04:00
Sam Lantinga 1326f406a6 Removed unnecessary assert in WIN_SetWindowOpacity()
Fixes https://github.com/libsdl-org/SDL/issues/15896

(cherry picked from commit f0e99e7c7f)
2026-06-27 21:10:47 -07:00
BZL 03d17f40bf Add Void GENESIS controller support
Add AndGAMER/Void Gaming USB IDs for Void GENESIS.

Recognize the Void GENESIS SInput VID/PID pair and set its device name.
Add DirectInput gamepad mappings for the wired and dongle DirectInput modes.

(cherry picked from commit 111bb79bf8)
2026-06-27 20:12:20 -07:00
Cameron Gutman ca7db3216d keyboard: Limit text input event size for sdl2-compat
(cherry picked from commit 32f460d357)
2026-06-27 17:34:52 -07:00
Frank Praznik 1de0c4e0f0 wayland: Attach EGL objects to custom and external surfaces during reconfiguration
They are required when using EGL with an external surface.

(cherry picked from commit 06795b00ad)
2026-06-18 10:58:24 -04:00
Frank Praznik 2dc9006711 wayland: External windows are never hidden
Needed for the GPU renderer to function properly.

(cherry picked from commit dbfddb6409)
2026-06-18 10:58:24 -04:00
Vicki Pfau 3bbbc946de Fix discrete Joy-Con mappings on Linux
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit ca67f19c8f)
2026-06-17 20:49:55 -07:00
Sam Lantinga c548acee53 Added SDL_HINT_ENABLE_STEAM_SCREEN_KEYBOARD
(cherry picked from commit c9b6581210)
2026-06-17 16:49:17 -07:00
tmkk 31e08f0bad hidapi: do not enumerate XInput devices owned by a kernel driver via libusb on macOS
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit cee2cb8ed1)
2026-06-17 06:53:08 -07:00
Pierre de La Morinerie f53ea45d43 SDL_joystick: add Austgame adapter to gamecube devices
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
"Austgame GameCube to USB converter" is an GameCube-to-USB adapter.

(cherry picked from commit 51e214a012)
2026-06-14 08:44:01 -07:00
Nintorch b7c986a164 Add normalized name for Emscripten joysticks
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 7bbd9d5c2c)
2026-06-13 07:20:53 -07:00
arnau.nau 7e0285b482 hidapi: fix function pointer type mismatch in backend table
The HIDAPI backend table used function pointers that didn't match the
macro-renamed backend function types, which trips Clang's function sanitizer.

Adding small wrappers so the backend table has the correct function types and
the cast to the backend-specific device type happens inside a direct call.
fixes #15821.

(cherry picked from commit 46d0ecead0)
2026-06-13 07:18:41 -07:00
Nintorch 6cdec7ac09 Fix Xbox One controller detection on the web
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 4f031ea5da)
2026-06-12 09:04:16 -07:00
Nintorch 1731bb0d8e Fix web crash for joystick without vibration
(cherry picked from commit 4a0d66116f)
2026-06-12 08:53:45 -07:00
Nintorch fdab62170e Fix JoyCon pair type detection on the web
(cherry picked from commit 5e54decf53)
2026-06-12 07:44:56 -07:00
Nintorch d4d6f50736 Don't modify the driver signature on the web
(cherry picked from commit 95dafa2bcd)
2026-06-12 07:43:29 -07:00
Frank Praznik b7b1f7843d EGL: Always pass the platform type when available
Always pass the EGL platform type for Wayland and X11, or the driver could potentially select the wrong backend if certain envvars are misconfigured.

(cherry picked from commit 34af24276f)
2026-06-12 10:26:51 -04:00
Sam Lantinga a5e02a0927 Fixed error C2440: 'function': cannot convert from 'int (__cdecl *)(libusb_context *,libusb_device *,libusb_hotplug_event,void *)' to 'libusb_hotplug_callback_fn'
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit df294acbae)
2026-06-10 13:29:30 -07:00
Sam Lantinga 7ad1368224 Added hotplug detection when using libusb
Also switched to a single thread for libusb read operations instead of one thread per device

(cherry picked from commit 1475239328)
2026-06-10 13:12:36 -07:00
Sam Lantinga fcb29e4fb4 Added support for Xbox controllers via libusb on macOS
A number of third party Xbox controllers are not supported by macOS, but work with libusb and the SDL HIDAPI driver.

(cherry picked from commit 18fc4d931a)
2026-06-10 13:12:29 -07:00
expikr 2e604c2bbb don't fetch timestamp again
(cherry picked from commit ed43ec0277)
2026-06-10 06:27:29 -07:00
Alejandro Perez dd1032282e Add Corsair as valid PS controller
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 14b0e9d922)
2026-06-09 19:50:04 -07:00
Ryan C. Gordon 6a854e035f audio: Split device "zombie" status into multiple stages.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
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.

(cherry picked from commit 6136358840)
2026-06-09 20:58:04 -04:00
Sam Lantinga 7cb03cfdc5 Fixed a hang reading the Xbox report descriptor on macOS
(cherry picked from commit 64998d2bc8)
2026-06-09 11:13:20 -07:00
Sam Lantinga 94ba53758f Fixed the Xbox 360 Controller showing as a Steam Virtual Gamepad on macOS
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit c62cc657a2)
2026-06-09 10:34:15 -07:00
QwertyChouskie c3fda242fd 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 https://github.com/libsdl-org/SDL/commit/7da728a642f2acfbba9543a3587363908d7aa1c3, 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 https://github.com/libsdl-org/SDL/commit/d7b1ba1bfca7c9bf4f57075258ccfa0e0c6b2051 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.

(cherry picked from commit 157c839139)
2026-06-09 10:15:20 -07:00
QwertyChouskie 3ca28ce521 Respect SDL_HINT_JOYSTICK_MFI
(cherry picked from commit 0bd95b0430)
2026-06-09 07:34:40 -07:00
Sanjay Govind 43fa2bdcad Add GIP vids and pids for stage tour instruments (#15788)
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 3f80c0b82a)
2026-06-08 22:08:53 -07:00
Sanjay Govind 218522e123 Add PID for red octane games, as they support sony detection
(cherry picked from commit 205777210e)
2026-06-08 20:24:23 -07:00
Nintorch 0ccd792a5d Add mappings for NES Switch controllers on Linux
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 2fd15d9e0d)
2026-06-05 08:56:45 -07:00
Zizin13 3b6f122830 Fix DirectInput POV handling for devices with extra hats
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 7341f04a12)
2026-06-04 12:23:49 -07:00
Thad House b152feee3f Enable extra player LED sets for PS5 Controllers
(cherry picked from commit 0c8feecce6)
2026-06-04 08:05:59 -07:00