Let the DDX decide on the XkbRulesDefaults.

Dan Nicholson dbn.lists at gmail.com
Tue Dec 16 12:05:17 PST 2008

On Tue, Dec 16, 2008 at 11:50 AM, Keith Packard <keithp at keithp.com> wrote:
> This patch removes the default rules setting from DIX and adds it to the
> xfree86 DDX. What happens with other X servers if I apply this patch?

I'm pretty sure they fall back to the builtin defaults in
xkb/xkbInit.c. They are defined in the XKB_DFLT_* macros. When I was
playing with caching keymaps, I was using the patch below with no
noticeable effects (watch out for gmail wrapping). I meant to write a
patch for a --with-xkb-default-rmlvo parameter for configure, but
didn't get around to it.

commit c3a5fc4e71b2c50b1981f777263e62ded7e8be0a
Author: Dan Nicholson <dbn.lists at gmail.com>
Date:   Thu Nov 20 16:13:40 2008 -0800

    Set sane XKB defaults at build time instead of overriding from dix

    DIX effectively sets the default XKB rules by resetting the defaults when
    setting up the core keyboard. Instead, just set the wanted defaults in
    the XKB macros where they can be altered at build time. The previous XKB
    defaults were bogus, anyway.

diff --git a/dix/devices.c b/dix/devices.c
index 583ecc0..e3d6de5 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -526,7 +526,6 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
 #ifdef XKB
         if (!noXkbExtension) {
             bzero(&names, sizeof(names));
-            XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
             XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modMap,
                                         CoreKeyboardBell, CoreKeyboardCtl);
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 3935f40..6d45d74 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -87,19 +87,19 @@ typedef struct      _SrvXkmInfo {

-#define        XKB_BASE_DIRECTORY      "/usr/lib/X11/xkb"
+#define        XKB_BASE_DIRECTORY      "/usr/share/X11/xkb"
-#define        XKB_DFLT_RULES_FILE     "rules"
+#define        XKB_DFLT_RULES_FILE     "base"
 #define        XKB_DFLT_KB_LAYOUT      "us"
-#define        XKB_DFLT_KB_MODEL       "dflt"
+#define        XKB_DFLT_KB_MODEL       "pc105"
 #define        XKB_DFLT_KB_VARIANT     NULL

More information about the xorg mailing list