diff options
Diffstat (limited to 'xserver/Xi/xipassivegrab.c')
-rw-r--r-- | xserver/Xi/xipassivegrab.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xserver/Xi/xipassivegrab.c b/xserver/Xi/xipassivegrab.c index c9ac2f855..10ffcd68a 100644 --- a/xserver/Xi/xipassivegrab.c +++ b/xserver/Xi/xipassivegrab.c @@ -247,9 +247,18 @@ ProcXIPassiveGrabDevice(ClientPtr client) } } - WriteReplyToClient(client, sizeof(rep), &rep); - if (rep.num_modifiers) - WriteToClient(client, rep.length * 4, modifiers_failed); + if (client->swapped) { + /* save the value before SRepXIPassiveGrabDevice swaps it */ + uint32_t length = rep.length; + WriteReplyToClient(client, sizeof(rep), &rep); + if (length) + WriteToClient(client, length * 4, modifiers_failed); + } + else { + WriteReplyToClient(client, sizeof(rep), &rep); + if (rep.num_modifiers) + WriteToClient(client, rep.length * 4, modifiers_failed); + } out: free(modifiers_failed); |