xserver: Branch 'server-1.4-branch' - 5 commits

Peter Hutterer whot at kemper.freedesktop.org
Mon Jul 28 17:53:01 PDT 2008


 Xi/chgdctl.c                         |    2 +-
 dix/devices.c                        |    3 +++
 hw/kdrive/src/kinput.c               |   16 ++++++++++------
 hw/xfree86/common/xf86Config.c       |   10 ++++------
 hw/xfree86/doc/man/xorg.conf.man.pre |   15 +++++++++++++++
 include/xkbsrv.h                     |    4 ++++
 xkb/xkbInit.c                        |   18 ++++++++++++++++++
 7 files changed, 55 insertions(+), 13 deletions(-)

New commits:
commit 48a9996192613ab259549cdb7c8735d2fb31ed78
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 29 10:00:01 2008 +0930

    Xi: ChangeDeviceControl presence events should set the appropriate devchange.
    
    Requires inputproto 1.4.4 or higher.
    (cherry picked from commit 591ef3c047ab3597fef9d687205e99c254ff2040)
    
    Modified to use the numeric value of DeviceControlChanged instead of the
    define, just so we don't bork out if someone rebuilds without updating
    inputproto. This is a released server, after all.

diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index 9676fb7..38793c9 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -261,7 +261,7 @@ out:
     if (ret == Success) {
         dpn.type = DevicePresenceNotify;
         dpn.time = currentTime.milliseconds;
-        dpn.devchange = 1;
+        dpn.devchange = 5; /* DeviceControlChanged */
         dpn.deviceid = dev->id;
         dpn.control = stuff->control;
         SendEventToAllWindows(dev, DevicePresenceNotifyMask,
commit 153c6d48c655b3eca9a33b7487b238b42a4a3f8e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Jul 3 15:05:14 2008 +0930

    xfree86: AllowEmptyInput is now enabled by default if hotplugging is enabled.
    
    Remove AEI check from configImpliedLayout as the setting isn't actually parsed
    at this point anyway (written by Sasha Hlusiak).
    
    Resurrect checkInput() and check for devices there if AEI is false (this also
    creates the default devices if required).
    
    Set AllowEmptyInput to enabled by default if hotplugging is enabled.
    (cherry picked from commit bea743f3d629bafdc301f40e9c0bc11382dfe8bc)
    
    Conflicts:
    
    	hw/xfree86/common/xf86Config.c
    	hw/xfree86/doc/man/xorg.conf.man.pre

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3c29497..2916402 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1081,9 +1081,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
 	xf86Info.aiglxFrom = X_CONFIG;
     }
 
-    xf86Info.allowEmptyInput = FALSE;
-    if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value))
-        xf86Info.allowEmptyInput = TRUE;
+    /* AllowEmptyInput is automatically true if we're hotplugging */
+    xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
+    xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
 
     xf86Info.useDefaultFontPath = TRUE;
     xf86Info.useDefaultFontPathFrom = X_DEFAULT;
@@ -1841,9 +1841,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
     indp = xnfalloc(sizeof(IDevPtr));
     *indp = NULL;
     servlayoutp->inputs = indp;
-    if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE))
-	return FALSE;
-    
+
     return TRUE;
 }
 
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 3ff5776..94baf13 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -672,6 +672,21 @@ default.
 .BI "Option \*qIgnoreABI\*q \*q" boolean \*q
 Allow modules built for a different, potentially incompatible version of
 the X server to load. Disabled by default.
+.TP 7
+.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
+If enabled, don't add the standard keyboard and mouse drivers, if there are no
+input devices in the config file.  Enabled by default if AutoAddDevices and
+AutoEnableDevices is enabled, otherwise disabled.
+.TP 7
+.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
+If this option is disabled, then no devices will be added from HAL events.
+Enabled by default.
+.TP 7
+.BI "Option \*qAutoEnableDevices\*q \*q" boolean \*q
+If this option is disabled, then the devices will be added (and the
+DevicePresenceNotify event sent), but not enabled, thus leaving policy up
+to the client.
+Enabled by default.
 .SH "MODULE SECTION"
 The
 .B Module
commit 9b62355847ce7df1ca144b4ebc9ff5c7286b573d
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed Jun 4 11:10:11 2008 +0930

    xkb: reset xkb_cached_map on CloseDownDevices.
    
    Could lead to some invalid pointers in the second server generation.
    (cherry picked from commit ff3adf3e564d94fea18e48f966de40a7ded1279e)

diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 87ee072..7723c74 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -291,6 +291,9 @@ XkbDeleteRulesDflts()
     XkbVariantDflt = NULL;
     _XkbFree(XkbOptionsDflt);
     XkbOptionsDflt = NULL;
+
+    XkbFreeKeyboard(xkb_cached_map, XkbAllComponentsMask, True);
+    xkb_cached_map = NULL;
 }
 
 /***====================================================================***/
commit 7cdef0d6fc3ec6705a61014b741a4c24dc60973b
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sun Jun 1 15:20:42 2008 +0930

    xkb: delete default rules when devices are closed.
    
    We only have one set of default rules options in xkb. When the second keyboard
    is brought up with Xkb options specified, these new options overwrite the old.
    In future server generations, the rules used for the VCK are a mixture of the
    default ones and ones previously specified for other keyboards. Simply
    resetting the xkb default rules to NULL avoids this issue.
    
    Reproducable by setting XkbLayout "de" and XkbVariant "nodeadkeys". In the
    second server generation, the VCK has "us(nodeadkeys)". This again produces a
    SIGABRT when the first key is hit.
    
    I could not figure out why the SIGABRT happens. This patch is avoiding the
    issue rather than fixing it.
    (cherry picked from commit 5a3d06b8f42473cea3741dc722a775deaa2b73f6)

diff --git a/dix/devices.c b/dix/devices.c
index f6f3c8e..c02b7ae 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -634,6 +634,9 @@ CloseDownDevices(void)
     inputInfo.off_devices = NULL;
     inputInfo.keyboard = NULL;
     inputInfo.pointer = NULL;
+#ifdef XKB
+    XkbDeleteRulesDflts();
+#endif
 }
 
 /**
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index acf3bb0..b52eb65 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -895,6 +895,10 @@ extern	void	XkbSetRulesDflts(
 	char *			/* options */
 );
 
+extern	void	XkbDeleteRulesDflts(
+	void
+);
+
 extern	void	XkbInitDevice(
 	DeviceIntPtr 	/* pXDev */
 );
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index c0867ad..87ee072 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -278,6 +278,21 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
     return;
 }
 
+void
+XkbDeleteRulesDflts()
+{
+    _XkbFree(XkbRulesFile);
+    XkbRulesFile = NULL;
+    _XkbFree(XkbModelDflt);
+    XkbModelDflt = NULL;
+    _XkbFree(XkbLayoutDflt);
+    XkbLayoutDflt = NULL;
+    _XkbFree(XkbVariantDflt);
+    XkbVariantDflt = NULL;
+    _XkbFree(XkbOptionsDflt);
+    XkbOptionsDflt = NULL;
+}
+
 /***====================================================================***/
 
 #if defined(luna)
commit 5903b4c749c1136d0f3e91d5e6321b08c31da4bf
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jun 2 11:04:41 2008 +0930

    kdrive: don't post motion event if there was no motion. #16179
    
    Based on the patch by Tomas Janousek.
    Backported from master to server-1.4.
    
    X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>
    (cherry picked from commit 26e7e69ab893d1f2b35213250ada40ec90944f62)

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 6c247c1..d53a0d9 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2066,7 +2066,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     int           (*matrix)[3] = kdPointerMatrix.matrix;
     unsigned long button;
     int           n;
-    int           dixflags;
+    int           dixflags = 0;
 
     if (!pi)
 	return;
@@ -2097,11 +2097,15 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     z = rz;
 
     if (flags & KD_MOUSE_DELTA)
-        dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
-    else
-        dixflags = POINTER_ABSOLUTE;
-
-    _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
+    {
+        if (x || y || z)
+            dixflags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    } else if ((pi->dixdev->valuator) && (x != pi->dixdev->valuator->lastx ||
+                                          y != pi->dixdev->valuator->lasty))
+            dixflags = POINTER_ABSOLUTE;
+
+    if (dixflags)
+        _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
 
     buttons = flags;
 


More information about the xorg-commit mailing list