diff options
Diffstat (limited to 'Xi/exevents.c')
-rw-r--r-- | Xi/exevents.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index ecfc9c900..c09f19be5 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -977,27 +977,28 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device) static void ProcessTouchEvent(DeviceEvent *ev, DeviceIntPtr device) { + TouchClassPtr t = device->touch; WindowPtr win; SpritePtr sprite; xEvent *xi2; int err, touch, i; if (ev->type == ET_TouchBegin) { - touch = CreateTouchPoint(device, ev->valuators.data[2]); + touch = CreateTouchPoint(device, ev->valuators.data[t->id_axis]); if (touch < 0) { DebugF("[Xi] %s: Could not assign touchpoint for %d\n", device->name, - ev->valuators.data[2]); + ev->valuators.data[t->id_axis]); return; } } else { - touch = FindTouchPoint(device, ev->valuators.data[2]); + touch = FindTouchPoint(device, ev->valuators.data[t->id_axis]); if (touch < 0) { DebugF("[Xi] %s: Received TouchMotion or TouchEnd event for " "inactive touchpoint %d\n", device->name, - ev->valuators.data[2]); + ev->valuators.data[t->id_axis]); return; } } @@ -1019,7 +1020,8 @@ ProcessTouchEvent(DeviceEvent *ev, DeviceIntPtr device) if (device->touch->mode == XIDirectTouch) { sprite = device->touch->spriteInfo[touch]->sprite; - win = XYToWindow(sprite, ev->valuators.data[0], ev->valuators.data[1]); + win = XYToWindow(sprite, ev->valuators.data[t->x_axis], + ev->valuators.data[t->y_axis]); } else { @@ -1292,8 +1294,13 @@ InitTouchValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, else if (ax->label == XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y)) dev->touch->y_axis = axnum; else if (ax->label == - XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_TRACKING_ID)) + XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_TRACKING_ID)) { + int i; + dev->touch->id_axis = axnum; + for (i = 0; i < dev->touch->numTouches; i++) + dev->touch->axisVal[i][axnum] = -1; + } } static void |