Input: Overhaul keyboard initialisation process

XkbInitKeyboardDeviceStruct is now the only valid keyboard
initialisation: all the details are hidden behind here.  This now makes
it impossible to supply a core keymap at startup.

If dev->key is valid, dev->key->xkbInfo->desc is also valid.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Daniel Stone
2008-12-26 18:38:25 +11:00
parent 40877c6680
commit 08363c5830
10 changed files with 223 additions and 554 deletions

View File

@@ -191,7 +191,6 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
{
static DeviceIntPtr lastMapNotifyDevice = NULL;
KeyClassPtr mk, dk; /* master, device */
BOOL sendNotify = FALSE;
int i;
if (device == master)
@@ -240,14 +239,8 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master)
for (i = 0; i < 8; i++)
mk->modifierKeyCount[i] = dk->modifierKeyCount[i];
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");
}
if (!XkbCopyKeymap(dk->xkbInfo->desc, mk->xkbInfo->desc, True))
FatalError("Couldn't pivot keymap from device to core!\n");
if (lastMapNotifyDevice != master) {
SendMappingNotify(master, MappingKeyboard,