Moving xkbcomp into the server

Peter Hutterer peter.hutterer at
Mon Nov 17 20:54:52 PST 2008

On Mon, Nov 17, 2008 at 11:25:25AM -0800, Dan Nicholson wrote:
> I decided to take a crack at moving xkbcomp into the server so it's
> not popen'd whenever a keymap is loaded. For the first crack, I'm
> trying to just leave xkbcomp pretty much unchanged except for the
> interface. What's causing me the most difficulty is converting to
> server API. One snag I've hit is XStringToKeysym. Here's an example
> usage in the xkbcomp parser:

As much as I'd like to see it in the server - is the popen the painful bit?
AFAIU, the current approach goes from RMLVO to Kkcstg to xkb to xkm, every
time we call InitKeyboardDeviceStruct.

Ideally, we'd like to cache and re-use as much as possible. Usually, all
keyboards come up with the same map anyway and compiling it again is
redundant. Just doing that might already save a significant chunk of time.
This should also be much easier to achieve, and if it provides a relevant
speedup it would be great as interim solution.

So the path is
  -> XkbDDXNamesFromRules:xkb/ddxLoad.c
        this is where all the rules parsing happens, skipping that may save
  -> XkbDDXLoadKeymapByNames:xkb/ddxLoad.c
        this is where xkbcomp is called with the Kcstg format. xkbcomp now
        parses that into an xkm format
  -> XkmReadFile:xkb/xkmread.c
        here we read in the compiled keymap and basically copy it into the
        internal structs.


More information about the xorg mailing list