mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-01 22:03:09 +00:00
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:
parent
40877c6680
commit
08363c5830
10 changed files with 220 additions and 551 deletions
|
|
@ -428,3 +428,36 @@ XkbRF_RulesPtr rules;
|
|||
|
||||
return complete;
|
||||
}
|
||||
|
||||
XkbDescPtr
|
||||
XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet *rmlvo)
|
||||
{
|
||||
XkbComponentNamesRec kccgst;
|
||||
XkbRF_VarDefsRec mlvo;
|
||||
XkbDescPtr xkb;
|
||||
char name[PATH_MAX];
|
||||
|
||||
if (!dev || !rmlvo) {
|
||||
LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mlvo.model = rmlvo->model;
|
||||
mlvo.layout = rmlvo->layout;
|
||||
mlvo.variant = rmlvo->variant;
|
||||
mlvo.options = rmlvo->options;
|
||||
|
||||
/* XDNFR already logs for us. */
|
||||
if (!XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, &kccgst))
|
||||
return NULL;
|
||||
|
||||
/* XDLKBN too, but it might return 0 as well as allocating. */
|
||||
if (!XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, 0, &xkb, name,
|
||||
PATH_MAX)) {
|
||||
if (xkb)
|
||||
XkbFreeKeyboard(xkb, 0, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return xkb;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue