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 2118

Summary: Use SDL_UDEV_* for joystick hotplugging [PATCH]
Product: SDL Reporter: Gabriel Jacobo <gabomdq>
Component: joystickAssignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: bonsairobo
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Joystick hotplugging using SDL_UDEV

Description Gabriel Jacobo 2013-09-28 18:53:31 UTC
Remove the udev code from the Linux joystick code and replace it by the common SDL_UDEV* stuff.
Comment 1 Gabriel Jacobo 2013-09-28 18:54:39 UTC
Created attachment 1343 [details]
Joystick hotplugging using SDL_UDEV
Comment 2 Gabriel Jacobo 2013-09-28 18:56:04 UTC
*** Bug 2033 has been marked as a duplicate of this bug. ***
Comment 3 Sam Lantinga 2013-10-01 04:55:49 UTC
Offhand it looks good.  Does it work?  If so, ship it! :)
Comment 4 Gabriel Jacobo 2013-10-01 11:54:49 UTC
http://hg.libsdl.org/SDL/rev/6b3cc8b7c589


Testing procedure was done using testjoystick. With a gamepad (a generic XBox 360 look alike, not recognized as a "controller") plugged in, I started testjoystick. Plugging in and out recognizes the joystick dissapearing and coming back.
With --disable-udev, testjoystick never notices the joystick going away, so I guess this is working.

A curiosity you are probably aware of, with the XBox 360 wireless receiver plugged in and the xpad module loaded, I always get 4 Xbox 360 joysticks reported by SDL, even though there's none "connected" wirelessly. It's probably related to the xpad driver though.