mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-30 21:53:25 +00:00
Input: Remove modifierKeyMap
Since modifierKeyMap is generated from modifierMap, just remove it, and only generate it when we need to send the modifier map to the client. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
cf6a2fc2bd
commit
f062e90a95
12 changed files with 335 additions and 319 deletions
28
Xi/getmmap.c
28
Xi/getmmap.c
|
|
@ -87,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue