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