diff options
author | marha <marha@users.sourceforge.net> | 2011-04-27 15:56:59 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-27 15:56:59 +0000 |
commit | 100633b3e7619842f345cb7603b0db6b5761dd11 (patch) | |
tree | 3c3af754c7e801c07263269837d6a05072ff834c /xorg-server/Xi/xipassivegrab.c | |
parent | 205a4bdae76f287126db9f45a4f0ba631e3efca1 (diff) | |
parent | 96d6df5da9cddedf4931bf8e17f96e242467c661 (diff) | |
download | vcxsrv-100633b3e7619842f345cb7603b0db6b5761dd11.tar.gz vcxsrv-100633b3e7619842f345cb7603b0db6b5761dd11.tar.bz2 vcxsrv-100633b3e7619842f345cb7603b0db6b5761dd11.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/Xi/xipassivegrab.c')
-rw-r--r-- | xorg-server/Xi/xipassivegrab.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xorg-server/Xi/xipassivegrab.c b/xorg-server/Xi/xipassivegrab.c index 487c2721b..fe8c3944a 100644 --- a/xorg-server/Xi/xipassivegrab.c +++ b/xorg-server/Xi/xipassivegrab.c @@ -43,6 +43,7 @@ #include "exevents.h"
#include "xipassivegrab.h"
#include "dixgrabs.h"
+#include "misc.h"
int
SProcXIPassiveGrabDevice(ClientPtr client)
@@ -87,6 +88,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) GrabParameters param;
void *tmp;
int mask_len;
+ int n;
REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
@@ -99,7 +101,10 @@ ProcXIPassiveGrabDevice(ClientPtr client) {
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
if (ret != Success)
+ {
+ client->errorValue = stuff->deviceid;
return ret;
+ }
}
if (stuff->grab_type != XIGrabtypeButton &&
@@ -156,6 +161,8 @@ ProcXIPassiveGrabDevice(ClientPtr client) return status;
status = CheckGrabValues(client, ¶m);
+ if (status != Success)
+ return status;
modifiers = (uint32_t*)&stuff[1] + stuff->mask_len;
modifiers_failed = calloc(stuff->num_modifiers, sizeof(xXIGrabModifierInfo));
@@ -190,6 +197,9 @@ ProcXIPassiveGrabDevice(ClientPtr client) info->status = status;
info->modifiers = *modifiers;
+ if (client->swapped)
+ swapl(&info->modifiers, n);
+
rep.num_modifiers++;
rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
}
@@ -197,10 +207,8 @@ ProcXIPassiveGrabDevice(ClientPtr client) WriteReplyToClient(client, sizeof(rep), &rep);
if (rep.num_modifiers)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, rep.length * 4, (char*)modifiers_failed);
- }
+ WriteToClient(client, rep.length * 4, (char*)modifiers_failed);
+
free(modifiers_failed);
return ret;
}
|