From 7840203027b67ffb3f0edfa58ba28ae232a293dd Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 26 Feb 2010 14:02:09 +1000 Subject: [PATCH] dix: Clip only into axis ranges if we're in absolute mode. A device in relative mode can easily provide valuators outside of the axis range. Signed-off-by: Peter Hutterer --- dix/getevents.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 82bb77b..197deb4 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -710,7 +710,7 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, /* if attached, clip both x and y to the defined limits (usually * co-ord space limit). If it is attached, we need x/y to go over the * limits to be able to change screens. */ - if(dev->u.master) { + if(dev->u.master && dev->valuator->mode == Absolute) { clipAxis(dev, 0, x); clipAxis(dev, 1, y); } @@ -720,7 +720,8 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, for (; i < num; i++) { dev->last.valuators[i + first] += valuators[i]; - clipAxis(dev, i, &dev->last.valuators[i + first]); + if (dev->valuator->mode == Absolute) + clipAxis(dev, i, &dev->last.valuators[i + first]); valuators[i] = dev->last.valuators[i + first]; } } -- 1.6.6.1