diff options
author | Christoph Brill <egore911@egore911.de> | 2008-09-16 15:49:54 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-09-25 11:56:22 +0930 |
commit | c405a69f83dab77cfe6c76f718a3ca5614a85918 (patch) | |
tree | 58f2483baa965d1034e7a97d6a1ee448b81e221b | |
parent | 102d1d6cfbc1cf3df3845b56ad1deb82a40d1cb8 (diff) |
Init x/y valuators with the axis range - if we have any.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
-rw-r--r-- | src/synaptics.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 2e9e31c..6b2cc43 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -782,6 +782,7 @@ static Bool DeviceInit(DeviceIntPtr dev) { LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate; + SynapticsPrivate *priv = (SynapticsPrivate *) (local->private); unsigned char map[SYN_MAX_BUTTONS + 1]; int i; @@ -807,11 +808,18 @@ DeviceInit(DeviceIntPtr dev) #endif ); /* X valuator */ - xf86InitValuatorAxisStruct(dev, 0, 0, -1, 1, 0, 1); + if (priv->minx < priv->maxx) + xf86InitValuatorAxisStruct(dev, 0, priv->minx, priv->maxx, 1, 0, 1); + else + xf86InitValuatorAxisStruct(dev, 0, 0, -1, 1, 0, 1); xf86InitValuatorDefaults(dev, 0); /* Y valuator */ - xf86InitValuatorAxisStruct(dev, 1, 0, -1, 1, 0, 1); + if (priv->miny < priv->maxy) + xf86InitValuatorAxisStruct(dev, 1, priv->miny, priv->maxy, 1, 0, 1); + else + xf86InitValuatorAxisStruct(dev, 1, 0, -1, 1, 0, 1); xf86InitValuatorDefaults(dev, 1); + #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 xf86MotionHistoryAllocate(local); #endif |