[ANNOUNCE] xf86-input-evdev 2.0.99.2
Peter Hutterer
peter.hutterer at who-t.net
Fri Oct 24 03:10:46 PDT 2008
On Fri, Oct 24, 2008 at 10:59:25AM +0100, Colin Guthrie wrote:
> It seems that my usb mouse wanted to make double clicks rather than
> single clicks when I tried this driver. Not overly sure why! When trying
> to update the xserver and getting inspired by the Fedora patches, I
> noticed a few that related to double events and AllowEmptyInput setting.
> As I had AllowEmptyInput set to on, could this be responsible for
> turning the two single clicks events into one double click?
Right, the server is picking the same device up twice (evdev + kbd/mouse).
Unfortunately, only some of these patches are upstream yet.
Your setup needs:
1. the xserver patch to switch the console mode to RAW (d936a423)
2. the xserver patch to enable AllowEmptyInput to TRUE (0b56b44a)
3. the patch below to disable kbd/mouse if AEI is on. This is one that would
break non-linux systems and leave them without input. I need to fix that
up.
For now, just having a ServerLayout section in your config should do the job.
Probably no config should work too, but I haven't tried that without 3. yet.
Cheers,
Peter
m d3863202cba03fe564d6cc1fe3641f017392c9e7 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at redhat.com>
Date: Thu, 16 Oct 2008 11:22:29 +1030
Subject: [PATCH] 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.
If no config file is present, force AEI on.
---
hw/xfree86/common/xf86Config.c | 39 +++++++++++++++++++++++++++++++++++++--
hw/xfree86/common/xf86Init.c | 2 ++
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index a1c2e34..ac80add 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 || implicitLayout)) {
+ if (!foundPointer && !xf86Info.allowEmptyInput) {
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 || implicitLayout)) {
+ if (!foundKeyboard && !xf86Info.allowEmptyInput) {
confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
xf86configptr->conf_input_lst);
if (!confInput) {
@@ -2481,6 +2481,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++;
+ }
+ }
}
/*
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 0774563..99fcdb3 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -698,6 +698,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.
--
1.6.0.1
More information about the xorg
mailing list