summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-05-23 11:51:53 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-05-23 12:01:37 +0930
commit6c9e9f8a40e20fb1761440acd2755f5fd31f4d44 (patch)
tree51093ef132aceaef19cfe43df0d42f9124b2157e /hw
parentfb146cbb0f28e4e480e5d16d61476ac46b5d00ce (diff)
input: instead of lastx/y, use a last.valuators[] array on the device.
During GetPointerEvents (and others), we need to access the last coordinates posted for this device from the driver (not as posted to the client!). Lastx/y is ok if we only have two axes, but with more complex devices we also need to transition between all other axes. ABI break, recompile your input drivers.
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86Xinput.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 996162402..2ae463013 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -505,8 +505,6 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
* convenient functions to post events
*/
-#define MAX_VALUATORS 36 /* XXX from comment in dix/getevents.c */
-
_X_EXPORT void
xf86PostMotionEvent(DeviceIntPtr device,
int is_absolute,
@@ -566,14 +564,14 @@ xf86PostMotionEventP(DeviceIntPtr device,
{
dx = valuators[0];
if (is_absolute)
- dx -= device->lastx;
+ dx -= device->last.valuators[0];
}
if (first_valuator == 1 || num_valuators >= 2)
{
dy = valuators[1 - first_valuator];
if (is_absolute)
- dy -= device->lasty;
+ dy -= device->last.valuators[1];
}
if (DGAStealMotionEvent(device, index, dx, dy))
@@ -833,11 +831,11 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum)
{
if (axnum == 0) {
dev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2;
- dev->lastx = dev->valuator->axisVal[0];
+ dev->last.valuators[0] = dev->valuator->axisVal[0];
}
else if (axnum == 1) {
dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2;
- dev->lasty = dev->valuator->axisVal[1];
+ dev->last.valuators[1] = dev->valuator->axisVal[1];
}
}