From ed22e6a3a671d66717ce3cfafbe1746f1689b5ae Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Wed, 5 Aug 2009 07:17:09 -0500 Subject: [PATCH] evdev.c: Allow relative/absolute axes init to fail gracefully I couldn't help it; I also swapped some lines around to be a little more consistent in the formatting and flow of logic; it's purely aesthetic. Signed-off-by: Michael Witten --- src/evdev.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 086fb0c..d53834b 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1447,11 +1447,11 @@ EvdevInit(DeviceIntPtr device) xf86Msg(X_INFO,"%s: touchpads and touchscreens ignore relative " "axes.\n", device->name); - if (EvdevAddAbsClass(device) != Success) - return !Success; - pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS; + if (EvdevAddAbsClass(device) != Success) + pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; + } else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) { int has_abs_axes = pEvdev->flags & EVDEV_ABSOLUTE_EVENTS; @@ -1460,24 +1460,24 @@ EvdevInit(DeviceIntPtr device) if (has_abs_axes) { - pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; - xf86Msg(X_INFO,"%s: relative axes found, ignoring absolute " "axes.\n", device->name); + + pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; } } else { - if (has_abs_axes && EvdevAddAbsClass(device) == Success) - pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS; - else - return !Success; + pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS; + + if (has_abs_axes && EvdevAddAbsClass(device) != Success) + pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; } } else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) if (EvdevAddAbsClass(device) != Success) - return !Success; + pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; #ifdef HAVE_PROPERTIES /* We drop the return value, the only time we ever want the handlers to -- 1.6.2.2.479.g2aec