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 - [PATCH] Implement joystick hotplugging fallback when udev is unavailable
Summary: [PATCH] Implement joystick hotplugging fallback when udev is unavailable
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-25 05:13 UTC by Cameron Gutman
Modified: 2019-07-15 17:58 UTC (History)
0 users

See Also:


Attachments
Hotplugging non-udev fallback patch (6.52 KB, patch)
2019-06-25 05:14 UTC, Cameron Gutman
Details | Diff
Hotplugging non-udev fallback patch v2 (6.72 KB, patch)
2019-06-25 06:05 UTC, Cameron Gutman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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