From 0548b79f79da61017af5efcd50a856db7d0faf3d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 3 Dec 2008 14:24:25 +1000 Subject: [PATCH] Let the DDX decide on the XkbRulesDefaults. Rather than assuming rules in the CoreKeyboardProc, init the default rules in InitCoreDevices, then re-use them later. In the xfree86 DDX, set the rules to "base" or "evdev", depending on whether we'll load kbd or evdev. If we create a new MD, use pc105,us as default and re-use the rules file used previously. Signed-off-by: Peter Hutterer Signed-off-by: Yan Li --- dix/devices.c | 1 - hw/xfree86/common/xf86Config.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index f7fef95..d89f6c3 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/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index f530ec4..ad72b16 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1032,6 +1032,12 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices); xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput); + /* AEI on? Then we're not using kbd, so use the evdev rules set. */ +#ifdef XKB + XkbSetRulesDflts(((xf86Info.allowEmptyInput) ? "evdev" : "base"), + "pc105", "us", NULL, NULL); +#endif + xf86Info.useDefaultFontPath = TRUE; xf86Info.useDefaultFontPathFrom = X_DEFAULT; if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) { -- 1.5.6.5