[PATCH v2 2/2] input: allow for max < min for relative axes on InitValuatorAxisStruct

Peter Hutterer peter.hutterer at who-t.net
Thu Sep 22 19:13:47 PDT 2011


Relative axes are initialized with 0, -1 but so far this never had any
effect as all users of this function (for relative axes) just set it to the
defaults anyway.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
This time without the change to return Bool.

 Xi/exevents.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 8a3c256..a6455e6 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1073,7 +1073,7 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int
 {
     AxisInfoPtr ax;
 
-    if (!dev || !dev->valuator || minval > maxval)
+    if (!dev || !dev->valuator || (minval > maxval && mode == Absolute))
         return FALSE;
     if (axnum >= dev->valuator->numAxes)
         return FALSE;
-- 
1.7.6



More information about the xorg-devel mailing list