summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-03-03 19:48:15 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-09-29 12:26:42 +1000
commitbc8aad2376207b5ca9c74effae67fb8183222d2e (patch)
tree6428af80708bbb34b2b8e6f700bda7bac35bb952
parent94c19a0a72403fc522e3d05eeb57f35e111a2562 (diff)
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>
-rw-r--r--dix/getevents.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index db4731569..7cb2968c4 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -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);