summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Jaeger <thjaeger@gmail.com>2009-01-05 01:26:42 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2009-01-08 11:45:22 +1000
commit3d549438c29004d78032ecc50ab45ca0e3f49623 (patch)
tree707ed8caf2a3e97f41fc1583ff8af785af13b743
parentb72c6b083baeadfd7b18b6025df054be502d6e28 (diff)
Don't alter device button maps in DoSetPointerMapping
Currently, if a device map differs from the core pointer map, then the request may return MappingBusy, even though all the affected core buttons are in the up state. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/devices.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/dix/devices.c b/dix/devices.c
index c51d9beef..b2a8f069c 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1833,36 +1833,23 @@ static int
DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n)
{
int rc, i = 0;
- DeviceIntPtr dev = NULL;
if (!device || !device->button)
return BadDevice;
- for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
- rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
- if (rc != Success)
- return rc;
- }
- }
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixManageAccess);
+ if (rc != Success)
+ return rc;
- for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
- for (i = 0; i < n; i++) {
- if ((device->button->map[i + 1] != map[i]) &&
- BitIsOn(device->button->down, i + 1)) {
- return MappingBusy;
- }
- }
+ for (i = 0; i < n; i++) {
+ if ((device->button->map[i + 1] != map[i]) &&
+ BitIsOn(device->button->down, i + 1)) {
+ return MappingBusy;
}
}
- for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
- for (i = 0; i < n; i++)
- dev->button->map[i + 1] = map[i];
- }
- }
+ for (i = 0; i < n; i++)
+ device->button->map[i + 1] = map[i];
return Success;
}
@@ -1919,7 +1906,6 @@ ProcSetPointerMapping(ClientPtr client)
return Success;
}
- /* FIXME: Send mapping notifies for all the extended devices as well. */
SendMappingNotify(ptr, MappingPointer, 0, 0, client);
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
return Success;