[PATCH] Xi: only list the device mode in XIQueryDevice, not the proximity bit.

Peter Hutterer peter.hutterer at who-t.net
Tue Jun 8 22:47:16 PDT 2010


The mode is either Absolute or Relative, the mode field in the
ValuatorClassRec also stores the proximity bit on the second bit for XI 1.x
clients, returning bad data to clients that just check for (mode ==
Absolute) or for (mode == Relative).

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 Xi/xiquerydevice.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
index 303c8b2..4c23486 100644
--- a/Xi/xiquerydevice.c
+++ b/Xi/xiquerydevice.c
@@ -349,7 +349,7 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
     info->value.frac = (int)(v->axisVal[axisnumber] * (1 << 16) * (1 << 16));
     info->resolution = v->axes[axisnumber].resolution;
     info->number = axisnumber;
-    info->mode = v->mode; /* Server doesn't have per-axis mode yet */
+    info->mode = v->mode & DeviceMode; /* Server doesn't have per-axis mode yet */
     info->sourceid = v->sourceid;
 
     if (!reportState)
-- 
1.6.5.2



More information about the xorg-devel mailing list