From c97c6c3de337f247406eaffd5845a847630ee6c1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 13 Mar 2009 16:17:20 +1000 Subject: [PATCH] xkb: fix a couple of device checks when looping through all devices. Generally, we want to apply stuff to the device and to all attached slave devices. --- xkb/xkb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 7e756d1ee..ba1a4f6fd 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -604,8 +604,7 @@ ProcXkbLatchLockState(ClientPtr client) status = Success; for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if ((dev == inputInfo.keyboard && tmpd->key && tmpd->coreEvents) || - tmpd == dev) { + if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { if (!tmpd->key->xkbInfo) continue; @@ -744,10 +743,8 @@ ProcXkbSetControls(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask); - for (tmpd = inputInfo.keyboard; tmpd; tmpd = tmpd->next) { - if ((dev == inputInfo.keyboard && tmpd->key && tmpd->coreEvents) || - tmpd == dev) { - + for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { + if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { xkbi = tmpd->key->xkbInfo; ctrl = xkbi->desc->ctrls; new = *ctrl; @@ -5834,9 +5831,7 @@ ProcXkbGetKbdByName(ClientPtr client) xkb->ctrls->num_groups= nTG; for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if (tmpd == dev || - (dev->id == inputInfo.keyboard->id && tmpd->key && - tmpd->coreEvents)) { + if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { if (tmpd != dev) XkbCopyDeviceKeymap(tmpd, dev);