diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-06-09 15:52:31 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-06-09 15:59:04 +1000 |
commit | a5c9b0ffb969f71ec73a6c65f5135f5aa7805a38 (patch) | |
tree | 63a7abceef0b7622df54238bb65adb239e17ac1d /src | |
parent | 3778f707cca0b9f023a8a5fc86e26776ef6e1b6c (diff) |
list: only check the last bit in the device mode.
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/list.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |