xfree86: If AEI is on, disable "kbd" and "mouse" devices.
This consists of two parts: In the implicit server layout, ignore those drivers when looking for a core device. And after finishing the server layout, run through the list of devices and remove any that use mouse or kbd. AEI is mutually exclusive with the kbd and mouse drivers, so pick either - or. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
This commit is contained in:
parent
6c45185955
commit
c264826da9
|
@ -1282,7 +1282,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
|||
}
|
||||
|
||||
/* 4. First pointer with 'mouse' as the driver. */
|
||||
if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
|
||||
if (!foundPointer && !xf86Info.allowEmptyInput) {
|
||||
confInput = xf86findInput(CONF_IMPLICIT_POINTER,
|
||||
xf86configptr->conf_input_lst);
|
||||
if (!confInput) {
|
||||
|
@ -1422,7 +1422,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
|
|||
}
|
||||
|
||||
/* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
|
||||
if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
|
||||
if (!foundKeyboard && !xf86Info.allowEmptyInput) {
|
||||
confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
|
||||
xf86configptr->conf_input_lst);
|
||||
if (!confInput) {
|
||||
|
@ -2445,6 +2445,41 @@ 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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -696,6 +696,7 @@ 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.
|
||||
|
|
Loading…
Reference in New Issue