summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Vigerlöf <Magnus.Vigerlof@ipbo.se>2008-02-02 22:45:31 +0100
committerMagnus Vigerlöf <Magnus.Vigerlof@ipbo.se>2008-02-05 21:12:52 +0100
commitf04c0838699f1a733735838e74cfbb1677b15dc4 (patch)
tree5bfed8daa694df6670922ef80392d1b0302e0295
parent12e532403210c15a25200ef448bfe9701735ab20 (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.
-rw-r--r--dix/getevents.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index 94cbd1553..ea1c764f2 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -308,10 +308,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;
+ }
}
/**