summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-03-08 14:41:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-03-09 10:53:27 +1000
commit33fee13361e745e1db29e250b08622c83046d488 (patch)
treeaf9fc1f445eeef7284de5340892fba60821ed3f0 /Xi
parenteb8141b6edd8b477c0ba796be71e985c35520a9b (diff)
Xi: fix XI2 passive grab reply length calculation
If modifiers failed, the reply length was 4 bytes too short. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xipassivegrab.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index 8663d12a1..3319ef913 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -191,7 +191,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
info->status = status;
info->modifiers = *modifiers;
rep.num_modifiers++;
- rep.length++;
+ rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
}
}
@@ -199,7 +199,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
if (rep.num_modifiers)
{
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed);
+ WriteSwappedDataToClient(client, rep.length * 4, (char*)modifiers_failed);
}
free(modifiers_failed);
return ret;