| Summary: | Touchscreen touches do not register unless user touches screen once before launching app | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Brett Ernst <brett.ernst.77> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | demlow |
| Version: | 2.0.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | Patch illustrating workaround | ||
Hey Ryan, this seems sane to me, but it's been a while since I've looked at that code. What do you think? Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! See bug 2974 for what may be an alternate, simpler solution to this problem. |
Created attachment 1398 [details] Patch illustrating workaround Environment: Arch Linux, NVIDIA graphics, Xorg server with NO window manager (kiosk project) and multiple touchscreen displays of different brands. After starting a fresh instance of Xorg on a touchscreen device (using the standard evdev driver), launching an SDL app before giving any input to the touchscreen will result in touch events being ignored and SDL_GetNumTouchDevices() returning zero. However, if the user taps the screen and then launches an SDL app again, SDL_GetNumTouchDevices() returns 1 and touch events are honored. All further instances of the application perform normally until the Xorg session is restarted. I traced this back to the fact that XIQueryInputDevice() does not return touch devices for which there has not yet been input for the current X session. The proposed fix is to watch for touch events from previously unrecognized touch devices and then add those devices if XIQueryInputDevice() returns information for them. I have attached a patch that illustrates one potential fix (tested in Arch Linux under Xorg with no window manager). It's a rough attempt but should illustrate a potential solution. May want to add the same logic to the other two touch events for completeness. Thanks!