Xi: don't care about CoreDevicePrivateKey when copying keys
If we get here, we must copy. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
23862ede59
commit
58a6b5b9ef
|
@ -203,8 +203,6 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
|
|||
dk = device->key;
|
||||
mk = master->key;
|
||||
|
||||
if (device != dixLookupPrivate(&master->devPrivates,
|
||||
CoreDevicePrivateKey)) {
|
||||
memcpy(mk->modifierMap, dk->modifierMap, MAP_LENGTH);
|
||||
|
||||
if (dk->maxKeysPerModifier)
|
||||
|
@ -245,25 +243,16 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
|
|||
for (i = 0; i < 8; i++)
|
||||
mk->modifierKeyCount[i] = dk->modifierKeyCount[i];
|
||||
|
||||
#ifdef XKB
|
||||
if (!noXkbExtension && dk->xkbInfo && dk->xkbInfo->desc) {
|
||||
if (!mk->xkbInfo || !mk->xkbInfo->desc)
|
||||
{
|
||||
if (dk->xkbInfo && dk->xkbInfo->desc) {
|
||||
if (!mk->xkbInfo || !mk->xkbInfo->desc) {
|
||||
XkbInitDevice(master);
|
||||
XkbFinishDeviceInit(master);
|
||||
}
|
||||
if (!XkbCopyKeymap(dk->xkbInfo->desc, mk->xkbInfo->desc, True))
|
||||
FatalError("Couldn't pivot keymap from device to core!\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
dixSetPrivate(&master->devPrivates, CoreDevicePrivateKey, device);
|
||||
sendNotify = TRUE;
|
||||
} else if (lastMapNotifyDevice != master)
|
||||
sendNotify = TRUE;
|
||||
|
||||
if (sendNotify)
|
||||
{
|
||||
if (lastMapNotifyDevice != master) {
|
||||
SendMappingNotify(master, MappingKeyboard,
|
||||
mk->curKeySyms.minKeyCode,
|
||||
(mk->curKeySyms.maxKeyCode -
|
||||
|
@ -271,6 +260,13 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
|
|||
serverClient);
|
||||
lastMapNotifyDevice = master;
|
||||
}
|
||||
|
||||
/* Copy the state here. This means we'll only have consistency
|
||||
* between state and active keymap, rather than between state and
|
||||
* keycodes pressed, but there's pretty much no way to win here,
|
||||
* so might as well go for the one that would seem to give the
|
||||
* least nonsensical result. */
|
||||
mk->xkbInfo->state = dk->xkbInfo->state;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue