dix: remove superfluous loop in change_modmap.
A device can only be attached to a single master device. So instead of looping and searching for the master device, we can just use dev->u.master directly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
cabff9007a
commit
7db55a0806
|
@ -275,14 +275,10 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap,
|
|||
do_modmap_change(client, tmp, modmap);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
|
||||
if (tmp->isMaster && tmp->u.lastSlave == dev) {
|
||||
else if (dev->u.master && dev->u.master->u.lastSlave == dev) {
|
||||
/* If this fails, expect the results to be weird. */
|
||||
if (check_modmap_change(client, tmp, modmap))
|
||||
do_modmap_change(client, tmp, modmap);
|
||||
}
|
||||
}
|
||||
if (check_modmap_change(client, dev->u.master, modmap))
|
||||
do_modmap_change(client, dev->u.master, modmap);
|
||||
}
|
||||
|
||||
return Success;
|
||||
|
|
Loading…
Reference in New Issue
Block a user