summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-15 08:33:07 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-22 12:24:21 +1000
commitcabff9007a4abad026b450a4aab155c7bcd94326 (patch)
tree5a434f3ff79db097caea262dcc8662eda5dc981e /hw
parenta8bd1e1f96d8e5380972a7dce8d9940cd912aa09 (diff)
xfree86: treat other drivers as mouse drivers in the config.
Historically, if no input device was referenced in the ServerLayout, the server would pick the first "mouse" device found in the xorg.conf. This patch gives evdev, synaptics, vmmouse and void the same status. If there is a section in the config file using this driver - use it as the core pointer. Device selection is in driver-order, not in config-order. If a "mouse" device is listed after a "synaptics" device, the "mouse" device gets preference. This replicates the original behaviour. This code only takes effect if AllowEmptyInput is off and there is no core pointer in the server layout. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86Config.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 73235a974..165958b07 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1090,8 +1090,8 @@ Bool xf86DRI2Enabled(void)
* 2. The "CorePointer" and "CoreKeyboard" InputDevices referred to by
* the active ServerLayout.
* 3. The first InputDevices marked as "CorePointer" and "CoreKeyboard".
- * 4. The first InputDevices that use the 'mouse' and 'keyboard' or 'kbd'
- * drivers.
+ * 4. The first InputDevices that use 'keyboard' or 'kbd' and a valid mouse
+ * driver (mouse, synaptics, evdev, vmmouse, void)
* 5. Default devices with an empty (default) configuration. These defaults
* will reference the 'mouse' and 'keyboard' drivers.
*/
@@ -1110,6 +1110,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
int count = 0;
MessageType from = X_DEFAULT;
int found = 0;
+ const char *mousedrivers[] = { "mouse", "synaptics", "evdev", "vmmouse",
+ "void", NULL };
/*
* First check if a core pointer or core keyboard have been specified
@@ -1219,13 +1221,15 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
}
}
- /* 4. First pointer with 'mouse' as the driver. */
+ /* 4. First pointer with an allowed mouse driver. */
if (!foundPointer && !xf86Info.allowEmptyInput) {
+ const char **driver = mousedrivers;
confInput = xf86findInput(CONF_IMPLICIT_POINTER,
xf86configptr->conf_input_lst);
- if (!confInput) {
- confInput = xf86findInputByDriver("mouse",
+ while (driver && !confInput) {
+ confInput = xf86findInputByDriver(*driver,
xf86configptr->conf_input_lst);
+ driver++;
}
if (confInput) {
foundPointer = TRUE;
@@ -1280,10 +1284,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
* section ... deal.
*/
for (devs = servlayoutp->inputs; devs && *devs; devs++) {
- if (!strcmp((*devs)->driver, "void") || !strcmp((*devs)->driver, "mouse") ||
- !strcmp((*devs)->driver, "vmmouse") || !strcmp((*devs)->driver, "evdev") ||
- !strcmp((*devs)->driver, "synaptics")) {
- found = 1; break;
+ const char **driver = mousedrivers;
+ while(*driver) {
+ if (!strcmp((*devs)->driver, *driver)) {
+ found = 1;
+ break;
+ }
+ driver++;
}
}
if (!found && !xf86Info.allowEmptyInput) {