xserver: Branch 'master' - 3 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue Dec 2 22:21:21 PST 2008


 Xi/chdevhier.c                 |    6 +++++-
 dix/devices.c                  |    1 -
 dix/getevents.c                |    3 +++
 hw/xfree86/common/xf86Config.c |    6 ++++++
 xkb/xkbInit.c                  |   29 ++++++++++++++++++++++++-----
 5 files changed, 38 insertions(+), 7 deletions(-)

New commits:
commit 9c5dd7337fa93fb1650cc017e523b939dcbf482a
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Wed Dec 3 14:24:25 2008 +1000

    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 <peter.hutterer at redhat.com>

diff --git a/Xi/chdevhier.c b/Xi/chdevhier.c
index db16349..631857d 100644
--- a/Xi/chdevhier.c
+++ b/Xi/chdevhier.c
@@ -117,7 +117,11 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
 
                     if (!c->sendCore)
                         ptr->coreEvents = keybd->coreEvents =  FALSE;
-
+#ifdef XKB
+                    /* supplying NULL for rules simply means we re-use
+                       whatever ruleset we used for the previous devices. */
+                    XkbSetRulesDflts(NULL, "pc105", "us", NULL, NULL);
+#endif
                     ActivateDevice(ptr);
                     ActivateDevice(keybd);
 
diff --git a/dix/devices.c b/dix/devices.c
index 6b8cecb..9feca90 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 1210a8f..9bf18b5 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1008,6 +1008,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)) {
commit 463e02e7de5da3e582a3a049110a476713c7210e
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Wed Dec 3 15:06:37 2008 +1000

    xkb: Allow NULL as rulesFile in XkbSetRulesDflts.
    
    If no rules file is given, simply re-use the previous one. If no RF is given
    the first time this function is called, use the built-in default.
    This includes fixing the built-in default to something that actually exists.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>

diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 35da3e9..c5d0a06 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -93,7 +93,7 @@ typedef struct	_SrvXkmInfo {
 #define	XKB_BIN_DIRECTORY	XKB_BASE_DIRECTORY
 #endif
 #ifndef XKB_DFLT_RULES_FILE
-#define	XKB_DFLT_RULES_FILE	"rules"
+#define	XKB_DFLT_RULES_FILE	"base"
 #endif
 #ifndef XKB_DFLT_KB_LAYOUT
 #define	XKB_DFLT_KB_LAYOUT	"us"
@@ -240,14 +240,33 @@ XkbSetRulesUsed(XkbRF_VarDefsPtr defs)
     return;
 }
 
+/**
+ * Set the default RMLVO for the next device to be initialised.
+ * If a parameter is NULL, the previous setting will be used. Use empty
+ * strings if you want to delete a previous setting.
+ *
+ * If @rulesFile is NULL and no previous @rulesFile has been set, the
+ * built-in default is chosen as default.
+ */
 _X_EXPORT void
 XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
 					char *variant,char *options)
 {
-    if (XkbRulesFile)
-	_XkbFree(XkbRulesFile);
-    XkbRulesFile= _XkbDupString(rulesFile);
-    rulesDefined= True;
+    if (!rulesFile && !XkbRulesFile)
+    {
+	LogMessage(X_WARNING, "[xkb] No rule given, and no previous rule "
+		              "defined. Defaulting to '%s'.\n",
+                              XKB_DFLT_RULES_FILE);
+	rulesFile = XKB_DFLT_RULES_FILE;
+    }
+
+    if (rulesFile) {
+	if (XkbRulesFile)
+	    _XkbFree(XkbRulesFile);
+	XkbRulesFile= _XkbDupString(rulesFile);
+	rulesDefined= True;
+    }
+
     if (model) {
 	if (XkbModelDflt)
 	    _XkbFree(XkbModelDflt);
commit e670fd889607fa712876218882cd4a9b46937661
Author: Peter Hutterer <peter.hutterer at redhat.com>
Date:   Wed Dec 3 11:55:13 2008 +1000

    dix: fix GetMaximumEventsNum(), may return a DCCE event too.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at redhat.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index 1671a24..88299b0 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -486,6 +486,9 @@ GetMaximumEventsNum(void) {
 #endif
         ret *= 2;
 
+    /* One possible DeviceClassesChangedEvent */
+    ret++;
+
     return ret;
 }
 


More information about the xorg-commit mailing list