fix/sdl3-gamepad-bugs #19
No reviewers
Labels
No labels
audio
bug
confirmed
cpu
critical
development
enhancement
gpu
graphics-backend:opengl
graphics-backend:vulkan
gui
help wanted
horizon/hle
i18n
infra
input
kernel
linux
macos
suggestion
windows
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
projects/Ryubing!19
Loading…
Reference in a new issue
No description provided.
Delete branch "Schuay/Ryubing:fix/sdl3-gamepad-bugs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Four SDL3 gamepad fixes, all affecting real users with Switch controllers.
Crash on reconnect / broken motion —
GetFeaturesFlag()was callingSDL_DestroyProperties()on properties owned by SDL internally, causing a use-after-free. This breaks gyro after the first read and crashes on reconnect. Fix: just don't destroy them.Thread safety in
GetGamepads()— was locking the wrong objects and holding locks acrossyieldboundaries, which is undefined behavior withSystem.Threading.Lock. Fix: snapshot IDs under_lock, iterate outside it.Rumble NPE on disconnect —
UpdateRumble()called_gamepad.Rumble()without a null check; throws if the controller disconnects mid-update. Fix:_gamepad?.Rumble(...).Linux: HIDAPI conflicts with
hid_nintendo— when thehid_nintendokernel module is loaded, it provides evdev nodes for both the gamepad and IMU that SDL3's evdev backend correctly combines. HIDAPI conflicts with it, breaking gyro and wireless hotplug. Fix: detect/sys/module/hid_nintendoat startup and disable HIDAPI for Switch controllers automatically. Overridable viaSDL_JOYSTICK_HIDAPI_SWITCH=1.Tested with an 8BitDo Ultimate Bluetooth Controller on Linux.
looks good to me, lgtm
@sh0inx wrote in #19 (comment):
Thank you, yes additional testing would be great for other controllers / OS combinations.