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:
30
Xi/setmmap.c
30
Xi/setmmap.c
@@ -91,33 +91,39 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||
int ret;
|
||||
xSetDeviceModifierMappingReply rep;
|
||||
DeviceIntPtr dev;
|
||||
KeyClassPtr kp;
|
||||
|
||||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
||||
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
if (stuff->length != ((sizeof(xSetDeviceModifierMappingReq) >> 2) +
|
||||
(stuff->numKeyPerModifier << 1)))
|
||||
return BadLength;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_SetDeviceModifierMapping;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
ret = SetModifierMapping(client, dev, stuff->length,
|
||||
(sizeof(xSetDeviceModifierMappingReq) >> 2),
|
||||
stuff->numKeyPerModifier, (BYTE *) & stuff[1],
|
||||
&kp);
|
||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
ret = change_modmap(client, dev, (KeyCode *) &stuff[1],
|
||||
stuff->numKeyPerModifier);
|
||||
if (ret == Success)
|
||||
ret = MappingSuccess;
|
||||
|
||||
if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) {
|
||||
rep.success = ret;
|
||||
if (ret == MappingSuccess)
|
||||
SendDeviceMappingNotify(client, MappingModifier, 0, 0, dev);
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
|
||||
&rep);
|
||||
} else if (ret == -1)
|
||||
return BadValue;
|
||||
}
|
||||
else if (ret == -1) {
|
||||
return BadValue;
|
||||
}
|
||||
else {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user