Moving xkbcomp into the server

Peter Hutterer peter.hutterer at
Tue Nov 18 14:21:36 PST 2008

On Tue, Nov 18, 2008 at 11:08:36AM -0800, Dan Nicholson wrote:
> > I think it'd be less effort to leave the converter as-is and remove the need
> > for calling it, but that's a guess only too.
> So, I took a look at this, and it was fairly easy to write an
> (untested) patch that checks if RMLVO has been changed and bailing out
> early from XkbInitKeyboardDeviceStruct if it hasn't. However, I think
> this still leaves you with two xkbcomps during the startup in the
> common configuration. XkbInitKeyboardDeviceStruct will be called first
> via InitCoreDevices with the default ruleset ("base", "pc105", "us",
> NULL, NULL). Then the driver will call XkbInitKeyboardDeviceStruct
> again with a ruleset that is probably different (most likely rules ==
> "evdev"). So, you're going to get two keymap conversions in most
> cases, anyway, but at least totally gratuitous conversions can be
> removed. I'll send that patch after I test it a bit.
As the theory goes, at least under linux we should be able to change the
default ruleset of "evdev", etc. anyway, which skips another xkbcomp
> But, why not "oh, same RMLVO, do nothing"? Oh, that's because you have
> to do it for each device. I guess then you probably want to keep the
> xkm file in that case, and only unlink during CloseDownDevices or
> something. Unfortunately, the xkm file is immediately deleted right
> now. This really only helps if you have multiple keyboards or you're
> hotplugging them, though.

well, since the xkms hardly ever change across server instances finding a way
to buffer them across multiple restarts would fix that problem too. Then you
really only have xkmRead() for each keyboard, no xkbcomp anymore.

Oh, btw:
whot at dingo:~$ grep "Configuring as keyboard" /var/log/Xorg.0.log 
(II) Power Button (FF): Configuring as keyboard
(II) AT Translated Set 2 keyboard: Configuring as keyboard
(II) Sleep Button (CM): Configuring as keyboard
(II) ThinkPad Extra Buttons: Configuring as keyboard
(II) Video Bus: Configuring as keyboard
(II) Video Bus: Configuring as keyboard

If I'm not completely wrong, xkbcomp will be called for all of them, so
chances are high that you have a "multiple keyboard" setup.


More information about the xorg mailing list