| Summary: | X11 touch device not found first time after boot | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Volumetric <demlow> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | brett.ernst.77, demlow, icculus |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | Patch for querying all X11 input devices, so some touch devices aren't skipped | ||
This patch is now https://hg.libsdl.org/SDL/rev/a7e9b75ec1c9, thanks! --ryan. |
Created attachment 2147 [details] Patch for querying all X11 input devices, so some touch devices aren't skipped On my systems the X11 code that looks for touch input devices misses the touch screen the first time after boot. Subsequent times work. This is under Fedora 20 and it manifests on very different hardware (workstation + touch screen, and also a tablet). Below and attached please find a patch that fixes this by looking at all X input devices, not just the master devices. It does redundantly checks some devices but correctly handles those duplicates, and fixes the problem. diff -r -C 3 SDL-2.0.4-9574/src/video/x11/SDL_x11xinput2.c SDL-2.0.4-9574.mod/src/video/x11/SDL_x11xinput2.c *** SDL-2.0.4-9574/src/video/x11/SDL_x11xinput2.c 2014-03-02 22:14:59.000000000 -0600 --- SDL-2.0.4-9574.mod/src/video/x11/SDL_x11xinput2.c 2015-05-01 15:55:27.181289471 -0500 *************** *** 183,189 **** SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; XIDeviceInfo *info; int ndevices,i,j; ! info = X11_XIQueryDevice(data->display, XIAllMasterDevices, &ndevices); for (i = 0; i < ndevices; i++) { XIDeviceInfo *dev = &info[i]; --- 183,189 ---- SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; XIDeviceInfo *info; int ndevices,i,j; ! info = X11_XIQueryDevice(data->display, XIAllDevices, &ndevices); for (i = 0; i < ndevices; i++) { XIDeviceInfo *dev = &info[i];