[PATCH] xkb: Check and load precompiled .xkm during startup if available

Pat Suwalski pat at suwalski.net
Tue Mar 16 06:58:55 PDT 2010


On 15/03/10 06:45 PM, Mikhail Gusarov wrote:
> New 'precompiled' subdir is added to xkb data dir, allowing to pre-compile
> keymaps to be loaded when server starts and hence avoid running xkbcomp, saving
> a bit of time.

<snip>

> +    int ret = snprintf(keymapName, keymapNameLen,
> +                       "%s/precompiled/%s-%s-%s-%s-%s.xkm",
> +                       XkbBaseDirectory,
> +                       names->keycodes ? names->keycodes : "def",
> +                       names->types ? names->types : "def",
> +                       names->compat ? names->compat : "def",
> +                       names->symbols ? names->symbols : "def",
> +                       names->geometry ? names->geometry : "def");

Is that name robust enough?

I wrote a very similar patch, but I based the name of the 
cached/precompiled file on a sha1 hash of source file.

That way, even if the contents of xkb-data change (upgrade, or 
whatever), the change is noticed.

--Pat


More information about the xorg-devel mailing list