src/video/x11/SDL_x11xinput2.c
changeset 12404 eb60e952b13f
parent 12069 317db3d3712c
child 12503 806492103856
equal deleted inserted replaced
12403:a4d730631698 12404:eb60e952b13f
   242 
   242 
   243     for (i = 0; i < ndevices; i++) {
   243     for (i = 0; i < ndevices; i++) {
   244         XIDeviceInfo *dev = &info[i];
   244         XIDeviceInfo *dev = &info[i];
   245         for (j = 0; j < dev->num_classes; j++) {
   245         for (j = 0; j < dev->num_classes; j++) {
   246             SDL_TouchID touchId;
   246             SDL_TouchID touchId;
       
   247             SDL_TouchDeviceType touchType;
   247             XIAnyClassInfo *class = dev->classes[j];
   248             XIAnyClassInfo *class = dev->classes[j];
   248             XITouchClassInfo *t = (XITouchClassInfo*)class;
   249             XITouchClassInfo *t = (XITouchClassInfo*)class;
   249 
   250 
   250             /* Only touch devices */
   251             /* Only touch devices */
   251             if (class->type != XITouchClass)
   252             if (class->type != XITouchClass)
   252                 continue;
   253                 continue;
   253 
   254 
       
   255             if (t->mode == XIDependentTouch) {
       
   256                 touchType = SDL_TOUCH_DEVICE_INDIRECT_RELATIVE;
       
   257             } else { /* XIDirectTouch */
       
   258                 touchType = SDL_TOUCH_DEVICE_DIRECT;
       
   259             }
       
   260 
   254             touchId = t->sourceid;
   261             touchId = t->sourceid;
   255             SDL_AddTouch(touchId, dev->name);
   262             SDL_AddTouch(touchId, touchType, dev->name);
   256         }
   263         }
   257     }
   264     }
   258     X11_XIFreeDeviceInfo(info);
   265     X11_XIFreeDeviceInfo(info);
   259 #endif
   266 #endif
   260 }
   267 }