open-src/xserver/xorg/restore-kbd-mouse.patch
changeset 606 068c11b419c9
child 705 24ca414edbff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/open-src/xserver/xorg/restore-kbd-mouse.patch	Thu Jan 15 12:55:00 2009 -0800
@@ -0,0 +1,145 @@
+From aeb01b73c94b5c2154406695970494a408ba1fba Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <[email protected]>
+Date: Wed, 14 Jan 2009 18:53:15 -0800
+Subject: [PATCH] Revert "xfree86: If AEI is on, disable "kbd" and "mouse" devices."
+
+This reverts commit 3245bf113619500b7b6cae3a3f31ddd2984cbc05.
+---
+ hw/xfree86/common/xf86Config.c       |   39 +--------------------------------
+ hw/xfree86/doc/man/xorg.conf.man.pre |    1 -
+ 2 files changed, 2 insertions(+), 38 deletions(-)
+
+diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
+index e91eadd..a1c2e34 100644
+--- a/hw/xfree86/common/xf86Config.c
++++ b/hw/xfree86/common/xf86Config.c
+@@ -1340,7 +1340,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
+     }
+ 
+     /* 4. First pointer with 'mouse' as the driver. */
+-    if (!foundPointer && !xf86Info.allowEmptyInput) {
++    if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
+ 	confInput = xf86findInput(CONF_IMPLICIT_POINTER,
+ 				  xf86configptr->conf_input_lst);
+ 	if (!confInput) {
+@@ -1480,7 +1480,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
+     }
+ 
+     /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
+-    if (!foundKeyboard && !xf86Info.allowEmptyInput) {
++    if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
+ 	confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
+ 				  xf86configptr->conf_input_lst);
+ 	if (!confInput) {
+@@ -2481,41 +2481,6 @@ addDefaultModes(MonPtr monitorp)
+ static void
+ checkInput(serverLayoutPtr layout, Bool implicit_layout) {
+     checkCoreInputDevices(layout, implicit_layout);
+-
+-    /* AllowEmptyInput and the "kbd" and "mouse" drivers are mutually
+-     * exclusive. Trawl the list for mouse/kbd devices and disable them.
+-     */
+-    if (xf86Info.allowEmptyInput && layout->inputs)
+-    {
+-        IDevPtr *dev = layout->inputs;
+-        BOOL warned = FALSE;
+-
+-        while(*dev)
+-        {
+-            if (strcmp((*dev)->driver, "kbd") == 0 ||
+-                strcmp((*dev)->driver, "mouse") == 0)
+-            {
+-                IDevPtr *current;
+-                if (!warned)
+-                {
+-                    xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using "
+-                            "drivers 'kbd' or 'mouse' will be disabled.\n");
+-                    warned = TRUE;
+-                }
+-
+-                xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->identifier);
+-
+-                current = dev;
+-                xfree(*dev);
+-
+-                do {
+-                    *current = *(current + 1);
+-                    current++;
+-                } while(*current);
+-            } else
+-                dev++;
+-        }
+-    }
+ }
+ 
+ /*
+diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
+index de93aaf..74f8cef 100644
+--- a/hw/xfree86/doc/man/xorg.conf.man.pre
++++ b/hw/xfree86/doc/man/xorg.conf.man.pre
+@@ -698,7 +698,6 @@ the X server to load. Disabled by default.
+ 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.
+-If AllowEmptyInput is on, devices using the kbd or mouse driver are ignored.
+ .TP 7
+ .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
+ If this option is disabled, then no devices will be added from HAL events.
+-- 
+1.5.6.5
+
+From 93d5891e83cc264c31f4da269434fec43a1900eb Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <[email protected]>
+Date: Wed, 14 Jan 2009 23:17:23 -0800
+Subject: [PATCH] Revert "xfree86: AllowEmptyInput is now enabled by default if hotplugging is enabled."
+
+This reverts commit c30f36c8c1dfd85deaf1c109823a1f15dd218ac7.
+---
+ hw/xfree86/common/xf86Config.c       |    8 +++++---
+ hw/xfree86/doc/man/xorg.conf.man.pre |    3 +--
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
+index a1c2e34..3812fe0 100644
+--- a/hw/xfree86/common/xf86Config.c
++++ b/hw/xfree86/common/xf86Config.c
+@@ -1088,9 +1088,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
+     }
+ #endif
+ 
+-    /* AllowEmptyInput is automatically true if we're hotplugging */
+-    xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
+-    xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
++    xf86Info.allowEmptyInput = FALSE;
++    if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value))
++        xf86Info.allowEmptyInput = TRUE;
+ 
+     xf86Info.useDefaultFontPath = TRUE;
+     xf86Info.useDefaultFontPathFrom = X_DEFAULT;
+@@ -1879,6 +1879,8 @@ 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 74f8cef..9f39808 100644
+--- a/hw/xfree86/doc/man/xorg.conf.man.pre
++++ b/hw/xfree86/doc/man/xorg.conf.man.pre
+@@ -696,8 +696,7 @@ 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.
++input devices in the config file.  Disabled by default.
+ .TP 7
+ .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
+ If this option is disabled, then no devices will be added from HAL events.
+
+-- 
+1.5.6.5
+