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 - Use SDL_UDEV_* for joystick hotplugging [PATCH]
Summary: Use SDL_UDEV_* for joystick hotplugging [PATCH]
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: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
: 2033 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-28 18:53 UTC by Gabriel Jacobo
Modified: 2013-10-01 11:54 UTC (History)
1 user (show)

See Also:


Attachments
Joystick hotplugging using SDL_UDEV (12.83 KB, patch)
2013-09-28 18:54 UTC, Gabriel Jacobo
Details | Diff

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