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);
|
do_modmap_change(client, tmp, modmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (dev->u.master && dev->u.master->u.lastSlave == dev) {
|
||||||
for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
|
/* If this fails, expect the results to be weird. */
|
||||||
if (tmp->isMaster && tmp->u.lastSlave == dev) {
|
if (check_modmap_change(client, dev->u.master, modmap))
|
||||||
/* If this fails, expect the results to be weird. */
|
do_modmap_change(client, dev->u.master, modmap);
|
||||||
if (check_modmap_change(client, tmp, modmap))
|
|
||||||
do_modmap_change(client, tmp, modmap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user