aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/getmmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
committermarha <marha@users.sourceforge.net>2009-09-06 18:48:27 +0000
commita915739887477b28d924ecc8417ee107d125bd6c (patch)
treec02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/Xi/getmmap.c
parent6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff)
downloadvcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz
vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2
vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/Xi/getmmap.c')
-rw-r--r--xorg-server/Xi/getmmap.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/xorg-server/Xi/getmmap.c b/xorg-server/Xi/getmmap.c
index c6c9c3362..ddf27a5f0 100644
--- a/xorg-server/Xi/getmmap.c
+++ b/xorg-server/Xi/getmmap.c
@@ -50,8 +50,6 @@ SOFTWARE.
*
*/
-#define NEED_EVENTS /* for inputstr.h */
-#define NEED_REPLIES
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -89,36 +87,34 @@ SProcXGetDeviceModifierMapping(ClientPtr client)
int
ProcXGetDeviceModifierMapping(ClientPtr client)
{
- CARD8 maxkeys;
DeviceIntPtr dev;
xGetDeviceModifierMappingReply rep;
- KeyClassPtr kp;
- int rc;
+ KeyCode *modkeymap = NULL;
+ int ret, max_keys_per_mod;
REQUEST(xGetDeviceModifierMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
+ if (ret != Success)
+ return ret;
- kp = dev->key;
- if (kp == NULL)
- return BadMatch;
-
- maxkeys = kp->maxKeysPerModifier;
+ ret = generate_modkeymap(client, dev, &modkeymap, &max_keys_per_mod);
+ if (ret != Success)
+ return ret;
rep.repType = X_Reply;
rep.RepType = X_GetDeviceModifierMapping;
- rep.numKeyPerModifier = maxkeys;
+ rep.numKeyPerModifier = max_keys_per_mod;
rep.sequenceNumber = client->sequence;
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
- rep.length = 2 * maxkeys;
+ rep.length = max_keys_per_mod << 1;
WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
+ WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap);
+
+ xfree(modkeymap);
- /* Reply with the (modified by DDX) map that SetModifierMapping passed in */
- WriteToClient(client, 8 * maxkeys, (char *)kp->modifierKeyMap);
return Success;
}