]> diplodocus.org Git - xorg-xinput/commitdiff
list: only check the last bit in the device mode.
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 9 Jun 2010 05:52:31 +0000 (15:52 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 9 Jun 2010 05:59:04 +0000 (15:59 +1000)
This works around a bug in X servers 1.7.x, 1.8.0 and 1.8.1 where the device
mode could sometimes be binary OR'd with the OutOfProximity flag. The result
was a value of 0b10 for relative and 0b11 for Absolute, both of which were
interpreted as relative by this code.

Affected is only the XIQueryDevice call, not the XListInputDevices call.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/list.c

index ecf1f4ba5499813d774e7e7740420d0d01d2749e..8633c62434f3632e58b2f2a2454f63272d32f6d8 100644 (file)
@@ -163,6 +163,10 @@ print_classes_xi2(Display* display, XIAnyClassInfo **classes,
                     XIValuatorClassInfo *v = (XIValuatorClassInfo*)classes[i];
                     char *name = v->label ?  XGetAtomName(display, v->label) : NULL;
 
+                    /* XXX: Bug in X servers 1.7..1.8.1, mode was |
+                       OutOfProximity. Remove this once 1.9 is out. */
+                    v->mode &= DeviceMode;
+
                     printf("\t\tDetail for Valuator %d:\n", v->number);
                     printf("\t\t  Label: %s\n",  (name) ? name : "None");
                     printf("\t\t  Range: %f - %f\n", v->min, v->max);