src/video/x11/SDL_x11xinput2.c
changeset 12404 eb60e952b13f
parent 12069 317db3d3712c
child 12503 806492103856
     1.1 --- a/src/video/x11/SDL_x11xinput2.c	Wed Nov 07 07:52:39 2018 -0800
     1.2 +++ b/src/video/x11/SDL_x11xinput2.c	Sat Nov 10 16:15:48 2018 -0400
     1.3 @@ -244,6 +244,7 @@
     1.4          XIDeviceInfo *dev = &info[i];
     1.5          for (j = 0; j < dev->num_classes; j++) {
     1.6              SDL_TouchID touchId;
     1.7 +            SDL_TouchDeviceType touchType;
     1.8              XIAnyClassInfo *class = dev->classes[j];
     1.9              XITouchClassInfo *t = (XITouchClassInfo*)class;
    1.10  
    1.11 @@ -251,8 +252,14 @@
    1.12              if (class->type != XITouchClass)
    1.13                  continue;
    1.14  
    1.15 +            if (t->mode == XIDependentTouch) {
    1.16 +                touchType = SDL_TOUCH_DEVICE_INDIRECT_RELATIVE;
    1.17 +            } else { /* XIDirectTouch */
    1.18 +                touchType = SDL_TOUCH_DEVICE_DIRECT;
    1.19 +            }
    1.20 +
    1.21              touchId = t->sourceid;
    1.22 -            SDL_AddTouch(touchId, dev->name);
    1.23 +            SDL_AddTouch(touchId, touchType, dev->name);
    1.24          }
    1.25      }
    1.26      X11_XIFreeDeviceInfo(info);