summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-09-24 14:05:52 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-09-26 12:37:37 +1000
commit9e39491166eb4540bbc72e963e673c976301e936 (patch)
tree97560fc0a9c027f4e8cc078949b8dbc152eca1ae
parenta9e2f7ac15f426560ac01689ec66f2db32424884 (diff)
Xi: fix length calculation for ValuatorState in QueryDeviceState reply.
The length field needs to include the bytes required for the valuators (INT32) as well. The reply length has the right value and since the valuator state is always last, clients didn't notice the wrong offset. Tested-by: Thomas Jaeger Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 6ee796e9bb4e46782b50a69c7b4fa5b49576f139)
-rw-r--r--Xi/queryst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Xi/queryst.c b/Xi/queryst.c
index 60ec32ec9..2ba1edb63 100644
--- a/Xi/queryst.c
+++ b/Xi/queryst.c
@@ -147,7 +147,7 @@ ProcXQueryDeviceState(ClientPtr client)
if (v != NULL) {
tv = (xValuatorState *) buf;
tv->class = ValuatorClass;
- tv->length = sizeof(xValuatorState);
+ tv->length = sizeof(xValuatorState) + v->numAxes * 4;
tv->num_valuators = v->numAxes;
tv->mode = v->mode;
buf += sizeof(xValuatorState);