From 1f876171067c04fc21fccd5a3051f982fd85c0f0 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 21 Oct 2009 19:07:36 +0000 Subject: Updated to xorg-server-1.7.99.1 --- xorg-server/Xi/queryst.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'xorg-server/Xi/queryst.c') 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 */ } -- cgit v1.2.3