Input: Set last valuators in GetPointerEvents only

Previously, various pieces of code, including acceleration, used to drop
the values into DeviceIntRec::last.valuators.  Remove all this and only
do it in GetPointerEvents after all transformation, acceleration and
clipping, so we're guaranteed to always have the correct values.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Daniel Stone 2011-03-03 19:48:15 +00:00 committed by Peter Hutterer
parent 94c19a0a72
commit bc8aad2376

View File

@ -701,7 +701,6 @@ moveAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
continue;
val = valuator_mask_get_double(mask, i);
clipAxis(dev, i, &val);
dev->last.valuators[i] = val;
valuator_mask_set_double(mask, i, val);
}
}
@ -731,7 +730,6 @@ moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
if (valuator_get_mode(dev, i) == Absolute &&
((i != 0 && i != 1) || clip_xy))
clipAxis(dev, i, &val);
dev->last.valuators[i] = val;
valuator_mask_set_double(mask, i, val);
}
}
@ -821,10 +819,6 @@ positionSprite(DeviceIntPtr dev, int mode, ScreenPtr scr, ValuatorMask *mask,
master->last.valuators[1] = *screeny;
}
/* dropy x/y (device coordinates) back into valuators for next event */
dev->last.valuators[0] = x;
dev->last.valuators[1] = y;
if (valuator_mask_isset(mask, 0))
valuator_mask_set_double(mask, 0, x);
if (valuator_mask_isset(mask, 1))
@ -1068,7 +1062,7 @@ QueuePointerEvents(DeviceIntPtr device, int type,
int
GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons,
int flags, const ValuatorMask *mask_in) {
int num_events = 1;
int num_events = 1, i;
CARD32 ms;
DeviceEvent *event;
RawDeviceEvent *raw;
@ -1153,6 +1147,12 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
clipValuators(pDev, &mask);
for (i = 0; i < valuator_mask_size(&mask); i++)
{
if (valuator_mask_isset(&mask, i))
pDev->last.valuators[i] = valuator_mask_get_double(&mask, i);
}
event = &events->device_event;
init_device_event(event, pDev, ms);