52682ba
From 9c5dd7337fa93fb1650cc017e523b939dcbf482a Mon Sep 17 00:00:00 2001
52682ba
From: Peter Hutterer<peter.hutterer@redhat.com>
52682ba
Date: Wed, 03  Dec  2008  04:24:25  +0000
52682ba
Subject: Let the DDX decide on the XkbRulesDefaults.
52682ba
52682ba
Rather than assuming rules in the CoreKeyboardProc, init the default rules in
52682ba
InitCoreDevices, then re-use them later.
52682ba
52682ba
In the xfree86 DDX, set the rules to "base" or "evdev", depending on whether
52682ba
we'll load kbd or evdev.
52682ba
52682ba
If we create a new MD, use pc105,us as default and re-use the rules file used
52682ba
previously.
52682ba
52682ba
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
52682ba
---
52682ba
diff --git a/dix/devices.c b/dix/devices.c
52682ba
index 6b8cecb..9feca90 100644
52682ba
--- a/dix/devices.c
52682ba
+++ b/dix/devices.c
52682ba
@@ -526,7 +526,6 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
52682ba
 #ifdef XKB
52682ba
         if (!noXkbExtension) {
52682ba
             bzero(&names, sizeof(names));
52682ba
-            XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
52682ba
             XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modMap,
52682ba
                                         CoreKeyboardBell, CoreKeyboardCtl);
52682ba
         }
52682ba
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
52682ba
index 1210a8f..9bf18b5 100644
52682ba
--- a/hw/xfree86/common/xf86Config.c
52682ba
+++ b/hw/xfree86/common/xf86Config.c
52682ba
@@ -1008,6 +1008,12 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
52682ba
     xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
52682ba
     xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
52682ba
 
52682ba
+    /* AEI on? Then we're not using kbd, so use the evdev rules set. */
52682ba
+#ifdef XKB
52682ba
+    XkbSetRulesDflts(((xf86Info.allowEmptyInput) ? "evdev" : "base"),
52682ba
+                     "pc105", "us", NULL, NULL);
52682ba
+#endif
52682ba
+
52682ba
     xf86Info.useDefaultFontPath = TRUE;
52682ba
     xf86Info.useDefaultFontPathFrom = X_DEFAULT;
52682ba
     if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) {
52682ba
--
52682ba
cgit v0.8.1-24-ge5fb