aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/queryst.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-10-21 21:22:47 +0000
committermarha <marha@users.sourceforge.net>2009-10-21 21:22:47 +0000
commite141b55eccf3c69d8ced513992e21463d37dbb03 (patch)
treeeaeeeda04d5b6ce82d43d04466164b44a74d0951 /xorg-server/Xi/queryst.c
parentd0fe50e45b3a640afa51eb8f45cf7c3a0df0740b (diff)
parent1f876171067c04fc21fccd5a3051f982fd85c0f0 (diff)
downloadvcxsrv-e141b55eccf3c69d8ced513992e21463d37dbb03.tar.gz
vcxsrv-e141b55eccf3c69d8ced513992e21463d37dbb03.tar.bz2
vcxsrv-e141b55eccf3c69d8ced513992e21463d37dbb03.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/Xi/queryst.c')
-rw-r--r--xorg-server/Xi/queryst.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xorg-server/Xi/queryst.c b/xorg-server/Xi/queryst.c
index 2ba1edb63..78b97a769 100644
--- a/xorg-server/Xi/queryst.c
+++ b/xorg-server/Xi/queryst.c
@@ -96,7 +96,7 @@ ProcXQueryDeviceState(ClientPtr client)
rep.sequenceNumber = client->sequence;
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
- if (rc != Success)
+ if (rc != Success && rc != BadAccess)
return rc;
v = dev->valuator;
@@ -130,8 +130,9 @@ ProcXQueryDeviceState(ClientPtr client)
tk->length = sizeof(xKeyState);
tk->num_keys = k->xkbInfo->desc->max_key_code -
k->xkbInfo->desc->min_key_code + 1;
- for (i = 0; i < 32; i++)
- tk->keys[i] = k->down[i];
+ if (rc != BadAccess)
+ for (i = 0; i < 32; i++)
+ tk->keys[i] = k->down[i];
buf += sizeof(xKeyState);
}
@@ -140,7 +141,8 @@ ProcXQueryDeviceState(ClientPtr client)
tb->class = ButtonClass;
tb->length = sizeof(xButtonState);
tb->num_buttons = b->numButtons;
- memcpy(tb->buttons, b->down, sizeof(b->down));
+ if (rc != BadAccess)
+ memcpy(tb->buttons, b->down, sizeof(b->down));
buf += sizeof(xButtonState);
}
@@ -152,7 +154,9 @@ ProcXQueryDeviceState(ClientPtr client)
tv->mode = v->mode;
buf += sizeof(xValuatorState);
for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
- *((int *)buf) = *values++;
+ if (rc != BadAccess)
+ *((int *)buf) = *values;
+ values++;
if (client->swapped) {
swapl((int *)buf, n); /* macro - braces needed */
}