diff options
author | Magnus Vigerlöf <Magnus.Vigerlof@ipbo.se> | 2008-02-02 22:45:31 +0100 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2008-05-07 19:22:23 +0200 |
commit | 1d79ba8193e9584370ffaaa8dffb4db604125dea (patch) | |
tree | 70a219c1dd8f57a74f645d802ed3b9f627575535 | |
parent | 7fa7031cfa9145f55881b87bc39f6e2c8a49ff76 (diff) |
Bug # 10324: dix: Allow arbitrary value ranges in GetPointerEvents
Don't use a possitive value as a marker for if a max-value
is defined on the valuators. Use the existence of a valid
value range instead. This will also make it possible to
define arbitrary start and end-values for min and max as
long as min < max.
(cherry picked from commit f04c0838699f1a733735838e74cfbb1677b15dc4)
-rw-r--r-- | dix/getevents.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 36c1bcfe0..8595eafb2 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -306,10 +306,13 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val) { AxisInfoPtr axes = pDev->valuator->axes + axisNum; - if (*val < axes->min_value) - *val = axes->min_value; - if (axes->max_value >= 0 && *val > axes->max_value) - *val = axes->max_value; + /* No clipping if the value-range <= 0 */ + if(axes->min_value < axes->min_value) { + if (*val < axes->min_value) + *val = axes->min_value; + if (*val > axes->max_value) + *val = axes->max_value; + } } /** |