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>
(cherry picked from commit 3d549438c2
)
This commit is contained in:
parent
364bcbea48
commit
3441917008
|
@ -1831,36 +1831,23 @@ static int
|
||||||
DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n)
|
DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n)
|
||||||
{
|
{
|
||||||
int rc, i = 0;
|
int rc, i = 0;
|
||||||
DeviceIntPtr dev = NULL;
|
|
||||||
|
|
||||||
if (!device || !device->button)
|
if (!device || !device->button)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixManageAccess);
|
||||||
if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
|
if (rc != Success)
|
||||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
|
return rc;
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
for (i = 0; i < n; i++) {
|
||||||
if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
|
if ((device->button->map[i + 1] != map[i]) &&
|
||||||
for (i = 0; i < n; i++) {
|
BitIsOn(device->button->down, i + 1)) {
|
||||||
if ((device->button->map[i + 1] != map[i]) &&
|
return MappingBusy;
|
||||||
BitIsOn(device->button->down, i + 1)) {
|
|
||||||
return MappingBusy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
for (i = 0; i < n; i++)
|
||||||
if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
|
device->button->map[i + 1] = map[i];
|
||||||
for (i = 0; i < n; i++)
|
|
||||||
dev->button->map[i + 1] = map[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -1917,7 +1904,6 @@ ProcSetPointerMapping(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Send mapping notifies for all the extended devices as well. */
|
|
||||||
SendMappingNotify(ptr, MappingPointer, 0, 0, client);
|
SendMappingNotify(ptr, MappingPointer, 0, 0, client);
|
||||||
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
|
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user