ChangeLog | 42 +++++++++++++++++++++++ configure.ac | 2 - debian/changelog | 6 +++ src/evdev.c | 97 +++++++++++++++++++++++++++++++++++++++++++------------ 4 files changed, 126 insertions(+), 21 deletions(-)
New commits: commit e3f74824b6ee913782024922307d92616953587e Author: Brice Goglin <[email protected]> Date: Thu Aug 6 07:29:46 2009 +0200 Prepare changelog for upload diff --git a/debian/changelog b/debian/changelog index 22e7749..bf406ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -xserver-xorg-input-evdev (1:2.2.4-1) UNRELEASED; urgency=low +xserver-xorg-input-evdev (1:2.2.4-1) unstable; urgency=low * New upstream release. - -- Brice Goglin <[email protected]> Thu, 06 Aug 2009 07:28:28 +0200 + -- Brice Goglin <[email protected]> Thu, 06 Aug 2009 07:29:42 +0200 xserver-xorg-input-evdev (1:2.2.3-1) unstable; urgency=low commit 697c1ec5d9665114264f43566b10994987921ae6 Author: Brice Goglin <[email protected]> Date: Thu Aug 6 07:29:39 2009 +0200 New upstream release diff --git a/ChangeLog b/ChangeLog index 28313ad..d3e1c9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,45 @@ +commit bf356d939925b537921e1f82559f92baa3a76bcc +Author: Peter Hutterer <[email protected]> +Date: Thu Aug 6 14:08:55 2009 +1000 + + evdev 2.2.4 + +commit 4c1c4f2c830dbfc34503d8ee4996f5bcd5547b6a +Author: Michael Witten <[email protected]> +Date: Tue Aug 4 03:11:49 2009 -0500 + + evdev.c: Fix/improve discrimination of rel/abs axes + + The relevant comment from evdev.c: + + We don't allow relative and absolute axes on the same device. The + reason is that some devices (MS Optical Desktop 2000) register both + rel and abs axes for x/y. + + The abs axes register min/max; this min/max then also applies to the + relative device (the mouse) and caps it at 0..255 for both axes. + So, unless you have a small screen, you won't be enjoying it much; + consequently, absolute axes are generally ignored. + + However, currenly only a device with absolute axes can be registered + as a touch{pad,screen}. Thus, given such a device, absolute axes are + used and relative axes are ignored. + + The code for initializing abs/rel axes has been abstracted out into + 3 functions, so that initialization in EvdevInit(device) is as easy + as: + + if (pEvdev->flags & (EVDEV_TOUCHPAD | EVDEV_TOUCHSCREEN)) + EvdevInitTouchDevice(device, pEvdev); + else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) + EvdevInitRelClass(device, pEvdev); + else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) + EvdevInitAbsClass(device, pEvdev); + + Signed-off-by: Michael Witten <[email protected]> + Signed-off-by: Peter Hutterer <[email protected]> + (cherry picked from commit f352598e45be86f9e24d9dba88c657f03f3b168e) + commit c0bee1b4d6d3664322b2f35775675ac84354f702 Author: Peter Hutterer <[email protected]> Date: Thu Jul 30 11:08:59 2009 +1000 diff --git a/debian/changelog b/debian/changelog index 9d7d76f..22e7749 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xserver-xorg-input-evdev (1:2.2.4-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Brice Goglin <[email protected]> Thu, 06 Aug 2009 07:28:28 +0200 + xserver-xorg-input-evdev (1:2.2.3-1) unstable; urgency=low * New upstream release. commit bf356d939925b537921e1f82559f92baa3a76bcc Author: Peter Hutterer <[email protected]> Date: Thu Aug 6 14:08:55 2009 +1000 evdev 2.2.4 diff --git a/configure.ac b/configure.ac index c89e356..5090e43 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-evdev], - 2.2.3, + 2.2.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-evdev) commit 4c1c4f2c830dbfc34503d8ee4996f5bcd5547b6a Author: Michael Witten <[email protected]> Date: Tue Aug 4 03:11:49 2009 -0500 evdev.c: Fix/improve discrimination of rel/abs axes The relevant comment from evdev.c: We don't allow relative and absolute axes on the same device. The reason is that some devices (MS Optical Desktop 2000) register both rel and abs axes for x/y. The abs axes register min/max; this min/max then also applies to the relative device (the mouse) and caps it at 0..255 for both axes. So, unless you have a small screen, you won't be enjoying it much; consequently, absolute axes are generally ignored. However, currenly only a device with absolute axes can be registered as a touch{pad,screen}. Thus, given such a device, absolute axes are used and relative axes are ignored. The code for initializing abs/rel axes has been abstracted out into 3 functions, so that initialization in EvdevInit(device) is as easy as: if (pEvdev->flags & (EVDEV_TOUCHPAD | EVDEV_TOUCHSCREEN)) EvdevInitTouchDevice(device, pEvdev); else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) EvdevInitRelClass(device, pEvdev); else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) EvdevInitAbsClass(device, pEvdev); Signed-off-by: Michael Witten <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> (cherry picked from commit f352598e45be86f9e24d9dba88c657f03f3b168e) diff --git a/src/evdev.c b/src/evdev.c index acf2943..9f330e3 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1163,6 +1163,64 @@ EvdevInitButtonMapping(InputInfoPtr pInfo) } +static void +EvdevInitAbsClass(DeviceIntPtr device, EvdevPtr pEvdev) +{ + if (EvdevAddAbsClass(device) == Success) { + + xf86Msg(X_INFO,"%s: initialized for absolute axes.\n", device->name); + + } else { + + xf86Msg(X_ERROR,"%s: failed to initialize for absolute axes.\n", + device->name); + + pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; + + } +} + +static void +EvdevInitRelClass(DeviceIntPtr device, EvdevPtr pEvdev) +{ + int has_abs_axes = pEvdev->flags & EVDEV_ABSOLUTE_EVENTS; + + if (EvdevAddRelClass(device) == Success) { + + xf86Msg(X_INFO,"%s: initialized for relative axes.\n", device->name); + + if (has_abs_axes) { + + xf86Msg(X_WARNING,"%s: ignoring absolute axes.\n", device->name); + pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; + } + + } else { + + xf86Msg(X_ERROR,"%s: failed to initialize for relative axes.\n", + device->name); + + pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS; + + if (has_abs_axes) + EvdevInitAbsClass(device, pEvdev); + } +} + +static void +EvdevInitTouchDevice(DeviceIntPtr device, EvdevPtr pEvdev) +{ + if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) { + + xf86Msg(X_WARNING,"%s: touchpads and touchscreens ignore relative " + "axes.\n", device->name); + + pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS; + } + + EvdevInitAbsClass(device, pEvdev); +} + static int EvdevInit(DeviceIntPtr device) { @@ -1181,28 +1239,27 @@ EvdevInit(DeviceIntPtr device) EvdevAddKeyClass(device); if (pEvdev->flags & EVDEV_BUTTON_EVENTS) EvdevAddButtonClass(device); - /* We don't allow relative and absolute axes on the same device. Reason - Reason being that some devices (MS Optical Desktop 2000) register both - rel and abs axes for x/y. - The abs axes register min/max, this min/max then also applies to the - relative device (the mouse) and caps it at 0..255 for both axis. - So unless you have a small screen, you won't be enjoying it much. - - FIXME: somebody volunteer to fix this. + + /* We don't allow relative and absolute axes on the same device. The + * reason is that some devices (MS Optical Desktop 2000) register both + * rel and abs axes for x/y. + * + * The abs axes register min/max; this min/max then also applies to the + * relative device (the mouse) and caps it at 0..255 for both axes. + * So, unless you have a small screen, you won't be enjoying it much; + * consequently, absolute axes are generally ignored. + * + * However, currenly only a device with absolute axes can be registered + * as a touch{pad,screen}. Thus, given such a device, absolute axes are + * used and relative axes are ignored. */ - if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) { - if (EvdevAddRelClass(device) == Success) - { - if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) - xf86Msg(X_INFO,"%s: relative axes found, ignoring absolute " - "axes.\n", device->name); - pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS; - } else - pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS; - } - if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) - EvdevAddAbsClass(device); + if (pEvdev->flags & (EVDEV_TOUCHPAD | EVDEV_TOUCHSCREEN)) + EvdevInitTouchDevice(device, pEvdev); + else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) + EvdevInitRelClass(device, pEvdev); + else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) + EvdevInitAbsClass(device, pEvdev); #ifdef HAVE_PROPERTIES /* We drop the return value, the only time we ever want the handlers to -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

