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 2148

Summary: [PATCH] Non-udev in joystick in Linux does not push JOYDEVICEADDED event
Product: SDL Reporter: Joseph Carter <tjcarter>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: tjcarter
Version: HG 2.1   
Hardware: x86   
OS: Mac OS X 10.8   
Attachments: Send SDL_JOYDEVICEADDED with or without udev

Description Joseph Carter 2013-10-11 10:18:41 UTC
Created attachment 1363 [details]
Send SDL_JOYDEVICEADDED with or without udev

Now that we've agreed the Windows mmjoystick driver is to be nuked (reminder: Nuke Windows mmjoystick driver…) Linux without udev is the only supported joystick target that does not fire off an event whenever it finds a joystick (basically at InitSubSystem time in this case.)  Without libudev, we cannot notify the user that a joystick has disappeared or give them notice of any new ones that show up, but our crude scan should be consistent and report the what it finds.

This patch does not address the FIXME regarding creation of SDL_PrivateJoyDeviceAdded and SDL_PrivateJoyDeviceRemoved.  I'll do that if desired, but it should be a separate commit.  Just add a note here if you want it.

This patch makes a similar change to where the SDL_JOYDEVICEREMOVED event is fired off, for the sake of consistency.  Tested with and without libudev on Ubuntu 13.04 under VMWare.
Comment 1 Joseph Carter 2013-10-11 13:13:45 UTC
And of course, while I was typing this, it looks like Sam applied the patch already.