x11: Don't try to use XInput2 multitouch if not supported.

Fixes #5889.
This commit is contained in:
Ryan C. Gordon 2022-07-04 12:48:32 -04:00
parent b085c18251
commit fdb86b8266
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
2 changed files with 14 additions and 3 deletions

View File

@ -31,9 +31,7 @@
void void
X11_InitTouch(_THIS) X11_InitTouch(_THIS)
{ {
if (X11_Xinput2IsMultitouchSupported()) { X11_InitXinput2Multitouch(_this);
X11_InitXinput2Multitouch(_this);
}
} }
void void

View File

@ -265,6 +265,11 @@ X11_InitXinput2Multitouch(_THIS)
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
XIDeviceInfo *info; XIDeviceInfo *info;
int ndevices,i,j; int ndevices,i,j;
if (!X11_Xinput2IsMultitouchSupported()) {
return;
}
info = X11_XIQueryDevice(data->display, XIAllDevices, &ndevices); info = X11_XIQueryDevice(data->display, XIAllDevices, &ndevices);
for (i = 0; i < ndevices; i++) { for (i = 0; i < ndevices; i++) {
@ -354,6 +359,10 @@ X11_Xinput2GrabTouch(_THIS, SDL_Window *window)
XIGrabModifiers mods; XIGrabModifiers mods;
XIEventMask eventmask; XIEventMask eventmask;
if (!X11_Xinput2IsMultitouchSupported()) {
return;
}
mods.modifiers = XIAnyModifier; mods.modifiers = XIAnyModifier;
mods.status = 0; mods.status = 0;
@ -379,6 +388,10 @@ X11_Xinput2UngrabTouch(_THIS, SDL_Window *window)
XIGrabModifiers mods; XIGrabModifiers mods;
if (!X11_Xinput2IsMultitouchSupported()) {
return;
}
mods.modifiers = XIAnyModifier; mods.modifiers = XIAnyModifier;
mods.status = 0; mods.status = 0;