aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/devices.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index b9225a195..2d5f6150e 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -1897,6 +1897,7 @@ ProcGetPointerMapping(ClientPtr client)
* the ClientPointer could change. */
DeviceIntPtr ptr = PickPointer(client);
ButtonClassPtr butc = ptr->button;
+ int nElts;
int rc;
REQUEST_SIZE_MATCH(xReq);
@@ -1905,15 +1906,16 @@ ProcGetPointerMapping(ClientPtr client)
if (rc != Success)
return rc;
+ nElts = (butc) ? butc->numButtons : 0;
rep.type = X_Reply;
- rep.nElts = (butc) ? butc->numButtons : 0;
+ rep.nElts = nElts;
rep.sequenceNumber = client->sequence;
- rep.length = ((unsigned) rep.nElts + (4 - 1)) / 4;
+ rep.length = ((unsigned) nElts + (4 - 1)) / 4;
WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
if (butc)
- WriteToClient(client, (int) rep.nElts, &butc->map[1]);
+ WriteToClient(client, nElts, &butc->map[1]);
return Success;
}
@@ -2677,6 +2679,8 @@ AllocDevicePair(ClientPtr client, const char *name,
*ptr = *keybd = NULL;
+ XkbInitPrivates();
+
pointer = AddInputDevice(client, ptr_proc, TRUE);
if (!pointer)