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 3583

Summary: X11 touch device can be permanently lost [Patch]
Product: SDL Reporter: Volumetric <demlow>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 2.0.5   
Hardware: x86_64   
OS: Linux   
Attachments: Adds a reset of the X11 touch devices when they are lost

Description Volumetric 2017-02-10 21:56:03 UTC
Created attachment 2697 [details]
Adds a reset of the X11 touch devices when they are lost

In X11 the SDL error "Unknown touch device" can occur after which the application stops recognizing touch events. For a kiosk-type application this results in a hang as far as the user is concerned. This is reproducible on HP Z220/Z230/Z240 workstations by swapping USB cables for a while and it also occurs with no physical changes, probably due to USB device power management. A workaround is to make SDL re-enumerate the touch devices like it does at startup. A patch is attached.
Comment 1 Sam Lantinga 2017-02-11 19:15:37 UTC
Workaround has been applied:
https://hg.libsdl.org/SDL/rev/5a77f977ad95

I wonder if there is an X11 event that is sent when the touch device goes away and needs to be re-enumerated?