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