Re: [Patch] AllowEmptyInput with no ServerLayout | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
Sascha: On Tue, Jul 01, 2008 at 04:20:08PM +0200, Sascha Hlusiak wrote: > when not using a layout section in xorg.conf, the function > checkCoreInputDevices is called too early, when option AllowEmptyInput has > not been parsed, so I end up with the default keyboard and default pointer > being added. > > The function checkCoreInputDevices is called later anyway so I felt free to > remove the call in configImpliedLayout. how about this one? In master, checkCoreInputDevices was only called in configImpliedLayout (was removed ages ago). This patch applies your changes and resurrects checkInput. AllowEmptyInput is enabled if AutoAddDevices and AutoEnableDevices is enabled, otherwise it's disabled. Cheers, Peter
>From bea743f3d629bafdc301f40e9c0bc11382dfe8bc Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@xxxxxxxxx>
Date: Wed, 2 Jul 2008 12:23:03 +0930
Subject: [PATCH] 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.
---
hw/xfree86/common/xf86Config.c | 18 ++++++++++++------
hw/xfree86/doc/man/xorg.conf.man.pre | 3 ++-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index afb5a39..53e8022 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1085,9 +1085,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
}
#endif
- 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;
@@ -1872,9 +1872,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;
}
@@ -2477,6 +2475,12 @@ addDefaultModes(MonPtr monitorp)
return TRUE;
}
+static void
+checkInput(serverLayoutPtr layout) {
+ if (!xf86Info.allowEmptyInput)
+ checkCoreInputDevices(layout, FALSE);
+}
+
/*
* load the config file and fill the global data structure
*/
@@ -2597,6 +2601,8 @@ xf86HandleConfigFile(Bool autoconfig)
configDRI(xf86configptr->conf_dri);
#endif
+ checkInput(&xf86ConfigLayout);
+
/*
* Handle some command line options that can override some of the
* ServerFlags settings.
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 8b66f89..3af1b78 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -696,7 +696,8 @@ 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. Disabled by default.
+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.
--
1.5.4.3
_______________________________________________ xorg mailing list xorg@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/xorg
[X Forum] [Devices] [XFree86] [XFree86 Newbie] [Site Home] [IETF Annouce] [Security] [Fontconfig] [Bugtraq] [Rubini] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Video for Linux] [Linux RAID] [Linux Resources]