We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4695

Summary: [PATCH] Implement joystick hotplugging fallback when udev is unavailable
Product: SDL Reporter: Cameron Gutman <cameron.gutman>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Hotplugging non-udev fallback patch
Hotplugging non-udev fallback patch v2

Description Cameron Gutman 2019-06-25 05:13:08 UTC
Udev is not available for SDL apps bundled into Flatpaks. In order to support hotplugging in Flatpaks, I've added a fallback polling-based hot add similar to how HIDAPI works without udev and used the ENODEV error code for hot remove. I also gave the non-udev codepaths some TLC while I was here.
Comment 1 Cameron Gutman 2019-06-25 05:14:04 UTC
Created attachment 3844 [details]
Hotplugging non-udev fallback patch
Comment 2 Cameron Gutman 2019-06-25 06:05:47 UTC
Created attachment 3845 [details]
Hotplugging non-udev fallback patch v2

Apologies, the initial patch had a use-after-free in HandlePendingRemovals(). This one is fixed.
Comment 3 Sam Lantinga 2019-07-15 17:58:27 UTC
This has been added for 2.0.10, thanks!
https://hg.libsdl.org/SDL/rev/886b79177762