summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-09-26 07:47:29 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-09-26 07:47:29 -0400
commit27612748e0ec20f3a23839f0a12e39f598dd722c (patch)
treef7780ffd4d1284e76a17166f28211cfb88796de7 /dix
parentb61461425eb15fcff2a58330d74fe5a5a1f226fc (diff)
parent3b114f2603fc2adeec7f5f8f20fe4870afb8dff1 (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: dix/devices.c
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c25
-rw-r--r--dix/getevents.c4
2 files changed, 19 insertions, 10 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 3c2aad867..3f4a33d6e 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1194,10 +1194,9 @@ SendMappingNotify(unsigned request, unsigned firstKeyCode, unsigned count,
}
#ifdef XKB
if (!noXkbExtension &&
- ((request == MappingKeyboard) || (request == MappingModifier))) {
- XkbApplyMappingChange(inputInfo.keyboard,request,firstKeyCode,count,
- client);
- }
+ ((request == MappingKeyboard) || (request == MappingModifier)))
+ XkbApplyMappingChange(inputInfo.keyboard, request, firstKeyCode, count,
+ client);
#endif
/* 0 is the server client */
@@ -1348,6 +1347,7 @@ int
ProcSetModifierMapping(ClientPtr client)
{
xSetModifierMappingReply rep;
+ DeviceIntPtr dev;
int rc;
REQUEST(xSetModifierMappingReq);
REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq);
@@ -1365,8 +1365,10 @@ ProcSetModifierMapping(ClientPtr client)
if (rc != Success)
return rc;
- /* FIXME: Send mapping notifies for all the extended devices as well. */
SendMappingNotify(MappingModifier, 0, 0, client);
+ for (dev = inputInfo.devices; dev; dev = dev->next)
+ if (dev->key && dev->coreEvents)
+ SendDeviceMappingNotify(client, MappingModifier, 0, 0, dev);
WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
return client->noClientException;
}
@@ -1437,16 +1439,19 @@ ProcChangeKeyboardMapping(ClientPtr client)
keysyms.maxKeyCode = stuff->firstKeyCode + stuff->keyCodes - 1;
keysyms.mapWidth = stuff->keySymsPerKeyCode;
keysyms.map = (KeySym *)&stuff[1];
- for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
- if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) {
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
if (!SetKeySymsMap(&pDev->key->curKeySyms, &keysyms))
return BadAlloc;
- }
- }
- /* FIXME: Send mapping notifies for all the extended devices as well. */
SendMappingNotify(MappingKeyboard, stuff->firstKeyCode, stuff->keyCodes,
client);
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if (pDev->key && pDev->coreEvents)
+ SendDeviceMappingNotify(client, MappingKeyboard,
+ stuff->firstKeyCode, stuff->keyCodes,
+ pDev);
+
return client->noClientException;
}
diff --git a/dix/getevents.c b/dix/getevents.c
index d6b10ff1c..c3af27f7e 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -402,6 +402,7 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
if (!events)
return 0;
+ /* DO NOT WANT */
if (type != KeyPress && type != KeyRelease)
return 0;
@@ -409,6 +410,9 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
(pDev->coreEvents && !inputInfo.keyboard->key))
return 0;
+ if (key_code < 8 || key_code > 255)
+ return 0;
+
if (pDev->coreEvents)
numEvents = 2;
else