From ad355fecee3965be576596aeed5da54d776edf1d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Sun, 15 Oct 2006 21:59:06 +0300 Subject: [PATCH] xkb: make sure we set the map on the right device, not necessarily core Forgot that all XKB requests took a device spec: the comparison of 'if working on the core keyboard, does this device send core events; or, is this device the core keyboard?' was broken. Instead, what we want is 'if working on the core keyboard, does this device send core events; or, is this device the one we're working on?'. --- xkb/xkb.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index 880f113eb..ba8fc7fbc 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -555,7 +555,7 @@ ProcXkbLatchLockState(ClientPtr client) for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { if ((dev == inputInfo.keyboard && tmpd->key && tmpd->coreEvents) || - tmpd == inputInfo.keyboard) { + tmpd == dev) { if (!tmpd->key->xkbInfo) continue; @@ -697,7 +697,7 @@ ProcXkbSetControls(ClientPtr client) for (tmpd = inputInfo.keyboard; tmpd; tmpd = tmpd->next) { if ((dev == inputInfo.keyboard && tmpd->key && tmpd->coreEvents) || - tmpd == inputInfo.keyboard) { + tmpd == dev) { xkbi = tmpd->key->xkbInfo; ctrl = xkbi->desc->ctrls; @@ -5441,12 +5441,13 @@ ProcXkbGetKbdByName(ClientPtr client) xkb->ctrls->num_groups= nTG; for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if ((dev == inputInfo.keyboard && tmpd->key && tmpd->coreEvents) || - tmpd == inputInfo.keyboard) { + if (tmpd == dev || + (dev->id == inputInfo.keyboard->id && tmpd->key && + tmpd->coreEvents)) { memcpy(tmpd->key->modifierMap, xkb->map->modmap, xkb->max_key_code + 1); - if (dev != inputInfo.keyboard) + if (tmpd != dev) XkbCopyKeymap(dev->key->xkbInfo->desc, tmpd->key->xkbInfo->desc, True); XkbUpdateCoreDescription(tmpd, True);