diff options
author | Keith Packard <keithp@keithp.com> | 2012-02-22 18:07:20 +1300 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-02-22 18:07:20 +1300 |
commit | 71594746c7da32e1c7986341a0da30f241a7a2be (patch) | |
tree | 35df232e9ef7097d8618bd9be7973b7c4e0e3103 | |
parent | d53235af85d50774c68347720ce132daf9a5bc49 (diff) | |
parent | eaba06a27c5520a02f08431ac1e4b0e0bdc22cd8 (diff) |
Merge remote-tracking branch 'whot/for-keith'
-rw-r--r-- | Xi/exevents.c | 30 | ||||
-rw-r--r-- | dix/getevents.c | 2 |
2 files changed, 20 insertions, 12 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 1ecc3ba5a..f390f6739 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -671,7 +671,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) if (from->touch) { - TouchPointInfoPtr tmp; + TouchClassPtr t, f; if (!to->touch) { classes = to->unused_classes; @@ -692,17 +692,22 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } else classes->touch = NULL; } - tmp = to->touch->touches; - memcpy(to->touch, from->touch, sizeof(TouchClassRec)); - to->touch->touches = tmp; - to->touch->sourceid = from->id; - } else if (to->touch) - { - ClassesPtr classes; - classes = to->unused_classes; - classes->touch = to->touch; - to->touch = NULL; + + + t = to->touch; + f = from->touch; + t->sourceid = f->sourceid; + t->max_touches = f->max_touches; + t->mode = f->mode; + t->buttonsDown = f->buttonsDown; + t->state = f->state; + t->motionMask = f->motionMask; + /* to->touches and to->num_touches are separate on the master, + * don't copy */ } + /* Don't remove touch class if from->touch is non-existent. The to device + * may have an active touch grab, so we need to keep the touch class record + * around. */ } /** @@ -1164,6 +1169,7 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti, { EmitTouchEnd(dev, ti, 0, 0); TouchEndTouch(dev, ti); + return; } if (ti->listeners[0].state == LISTENER_EARLY_ACCEPT) @@ -2215,7 +2221,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) if (BitIsOn(mouse->button->down, i)) - SetBit(&xi2event[1], i); + SetBit(&xi2event[1], mouse->button->map[i]); if (dev->key) { diff --git a/dix/getevents.c b/dix/getevents.c index 7678aa1f2..6ea4ba010 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -360,6 +360,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) if (i >= lastSlave->valuator->numAxes) { pDev->last.valuators[i] = 0; + valuator_mask_set_double(pDev->last.scroll, i, 0); } else { @@ -367,6 +368,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev) val = rescaleValuatorAxis(val, lastSlave->valuator->axes + i, pDev->valuator->axes + i, 0, 0); pDev->last.valuators[i] = val; + valuator_mask_set_double(pDev->last.scroll, i, val); } } } |