configure.ac | 5 +---- man/evdev.man | 2 +- src/emuMB.c | 6 ++++++ src/emuWheel.c | 9 --------- src/evdev.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++----------- 5 files changed, 54 insertions(+), 25 deletions(-)
New commits: commit c0bee1b4d6d3664322b2f35775675ac84354f702 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Thu Jul 30 11:08:59 2009 +1000 evdev 2.2.3 Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/configure.ac b/configure.ac index 87a3b18..c89e356 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-evdev], - 2.2.2, + 2.2.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-evdev) commit 8acc999d404b9b6012588e2021324553dda9405d Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Thu Jul 30 09:38:31 2009 +1000 Evdev doesn't require inputproto. None of the inputproto headers seem to be included anywhere. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit 6f4634111a83808bc52e7e53733cf2d3bab0cccd) Conflicts: configure.ac diff --git a/configure.ac b/configure.ac index 3f23d21..87a3b18 100644 --- a/configure.ac +++ b/configure.ac @@ -68,9 +68,6 @@ if test "x$BUILD_TEST" = "xyes"; then AC_SUBST([DLOPEN_LIBS]) fi -# Checks for extensions -XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) - # Checks for pkg-config packages. We need to be able to override sdkdir # to satisfy silly distcheck requirements. PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES) commit 3cce7fa38a152ba66d379591e6e3ece60bd73fdd Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Fri Jun 26 09:37:29 2009 +1000 If a device fails to initialize relative axes, init the abs. axes instead. Some devices have relative axes that don't count (scroll wheels). In this case, don't claim we've initialized relative axes, continue with the absolute axes instead. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit b07ab6ea97b779b26e7ae8326528c262cc9907a1) diff --git a/src/evdev.c b/src/evdev.c index 490fa44..acf2943 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1061,6 +1061,9 @@ EvdevAddRelClass(DeviceIntPtr device) if (TestBit(REL_DIAL, pEvdev->rel_bitmask)) num_axes--; + if (num_axes <= 0) + return !Success; + pEvdev->num_vals = num_axes; memset(pEvdev->vals, 0, num_axes * sizeof(int)); @@ -1188,12 +1191,17 @@ EvdevInit(DeviceIntPtr device) FIXME: somebody volunteer to fix this. */ if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) { - EvdevAddRelClass(device); - 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 if (pEvdev->flags & EVDEV_ABSOLUTE_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); #ifdef HAVE_PROPERTIES commit c793aa27381dc346d88a3e7d8bdb90dd8d3ed39c Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Mon Jul 20 14:52:34 2009 +1000 Don't register middle mouse button emulation handlers for keyboards. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit 2994825665790dc8e35b2944e0d411f3cc9f76fd) diff --git a/src/emuMB.c b/src/emuMB.c index 41d0d2c..b29f552 100644 --- a/src/emuMB.c +++ b/src/emuMB.c @@ -327,6 +327,9 @@ EvdevMBEmuPreInit(InputInfoPtr pInfo) void EvdevMBEmuOn(InputInfoPtr pInfo) { + if (!pInfo->dev->button) /* don't init for keyboards */ + return; + RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler, EvdevMBEmuWakeupHandler, (pointer)pInfo); @@ -335,6 +338,9 @@ EvdevMBEmuOn(InputInfoPtr pInfo) void EvdevMBEmuFinalize(InputInfoPtr pInfo) { + if (!pInfo->dev->button) /* don't cleanup for keyboards */ + return; + RemoveBlockAndWakeupHandlers (EvdevMBEmuBlockHandler, EvdevMBEmuWakeupHandler, (pointer)pInfo); commit 9f3632c0b6c181706daf661646de5994217c0bb2 Author: Oliver McFadden <oliver.mcfad...@nokia.com> Date: Thu Jul 16 18:25:37 2009 +0300 Coverity Prevent: NO_EFFECT in EvdevWheelEmuSetProperty: Event unsigned_compare: Comparing unsigned less than zero is never true. "pEvdev->emulateWheel.timeout < 0UL" 342 if (pEvdev->emulateWheel.timeout < 0) Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit 9bfd9e8a3683f14860149ae9f842e88828cc0960) diff --git a/src/emuWheel.c b/src/emuWheel.c index 7d3eb24..2854736 100644 --- a/src/emuWheel.c +++ b/src/emuWheel.c @@ -337,15 +337,6 @@ EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, 16, PropModeReplace, 1, &pEvdev->emulateWheel.inertia, TRUE); } - - /* Don't enable with negative timeout */ - if (pEvdev->emulateWheel.timeout < 0) - { - pEvdev->emulateWheel.timeout = 200; - XIChangeDeviceProperty(dev, prop_wheel_timeout, XA_INTEGER, 16, - PropModeReplace, 1, - &pEvdev->emulateWheel.timeout, TRUE); - } } } else if (atom == prop_wheel_button) commit 06b303f26d5fab17b7d82dbf2bda3f77dad2364c Author: Asbj�rn Sannes <a...@sannes.org> Date: Wed Jul 1 09:51:12 2009 +0200 evdev: Fix spelling of property in man page to match source code. #22571 Signed-off-by: Asbj�rn Sannes <a...@sannes.org> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit db8b1ca5cffbc48f7d9c5c166489c714ac92ea86) diff --git a/man/evdev.man b/man/evdev.man index b6ad1f1..07f125a 100644 --- a/man/evdev.man +++ b/man/evdev.man @@ -171,7 +171,7 @@ server, such as touchscreens that require run-time calibration. .BI "Evdev Axis Inversion" 2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis. .TP 7 -.BI "Evdev Axis Swap" +.BI "Evdev Axes Swap" 1 boolean value (8 bit, 0 or 1). 1 swaps x/y axes. .TP 7 .BI "Evdev Drag Lock Buttons" commit 4dda242d56a7830d5b44d7e58cf6a95f62a617ce Author: Derek Upham <s...@blarg.net> Date: Thu May 21 00:15:28 2009 -0700 evdev: Prevent driver from processing motion events that it has not configured. #21832 The current implementation initializes itself to support relative motion events, or absolute motion events, or neither. But the event-handling code attempts to process all events, no matter what the initialization was. This patch reproduces the flag tests found during init, to skip events that the driver doesn't support. Signed-off-by: Derek Upham <s...@blarg.net> Signed-off-by: Julien Cristau <jcris...@debian.org> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit 0a3657d2ee62f4086e9687218cb33835ba61a0b3) diff --git a/src/evdev.c b/src/evdev.c index 3a9fb0e..490fa44 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -362,6 +362,10 @@ EvdevProcessEvent(InputInfoPtr pInfo, struct input_event *ev) switch (ev->type) { case EV_REL: + /* Ignore EV_REL events if we never set up for them. */ + if (!(pEvdev->flags & EVDEV_RELATIVE_EVENTS)) + break; + /* Handle mouse wheel emulation */ if (EvdevWheelEmuFilterMotion(pInfo, ev)) break; @@ -392,6 +396,10 @@ EvdevProcessEvent(InputInfoPtr pInfo, struct input_event *ev) break; case EV_ABS: + /* Ignore EV_ABS events if we never set up for them. */ + if (!(pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)) + break; + if (ev->code > ABS_MAX) break; pEvdev->vals[pEvdev->axis_map[ev->code]] = value; @@ -1179,9 +1187,13 @@ EvdevInit(DeviceIntPtr device) FIXME: somebody volunteer to fix this. */ - if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) + if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) { EvdevAddRelClass(device); - else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) + 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 if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) EvdevAddAbsClass(device); #ifdef HAVE_PROPERTIES commit 4efe0d272ed6ef7bda4cc005ad6033f2b1916fdc Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Thu May 21 13:30:10 2009 +1000 Deal with BTN_3 to BTN_9 buttons. These buttons were previously mapped to 0, i.e. inactive. This patch slightly improves things in that the buttons are now mapped to 8+. Devices that have both BTN_3 and BTN_SIDE (or a similar pair in that sequence) have both mapped to the same button number though. Devices that have BTN_LEFT, BTN_0, BTN_3 and BTN_SIDE have the last three mapped to 8 (and their followers have double-mappings too). We'll fix that once we actually see devices affected by this. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit dc2191285e799be891787e1f64d10c1cba271240) diff --git a/src/evdev.c b/src/evdev.c index b880c6a..3a9fb0e 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1767,6 +1767,17 @@ EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code) button = (TestBit(BTN_RIGHT, pEvdev->key_bitmask)) ? 10 : 3; break; + /* FIXME: BTN_3.. and BTN_SIDE.. have the same button mapping */ + case BTN_3: + case BTN_4: + case BTN_5: + case BTN_6: + case BTN_7: + case BTN_8: + case BTN_9: + button = (code - BTN_0 + 5); + break; + case BTN_SIDE: case BTN_EXTRA: case BTN_FORWARD: commit 1432b5153ec2666845c2017eedc3c166fd8c8e3c Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Thu May 21 10:23:37 2009 +1000 Only initialize the number of buttons we actually have. This takes into account driver-configured button mappings, i.e. if device with one button has this button mapped to 25 through the ButtonMapping option, the X server will think the device has result 25 buttons. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit 255b9f6bbf374a315750019c6fadc5f82fb7d41d) diff --git a/src/evdev.c b/src/evdev.c index a9e1d27..b880c6a 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1095,9 +1095,7 @@ EvdevAddButtonClass(DeviceIntPtr device) pInfo = device->public.devicePrivate; pEvdev = pInfo->private; - /* FIXME: count number of actual buttons */ - if (!InitButtonClassDeviceStruct(device, ArrayLength(pEvdev->btnmap), - pEvdev->btnmap)) + if (!InitButtonClassDeviceStruct(device, pEvdev->buttons, pEvdev->btnmap)) return !Success; return Success; commit b8519930e415043545e87ea660f6f0b3109537bf Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed May 20 11:57:01 2009 +1000 Ensure enough buttons are advertised to pass the button mapping. Some buttons are mapped to higher button numbers. For example, BTN_0 is posted as button 8 if BTN_LEFT is present. On top of that, the driver-specific button mapping may map the button to something else again. We need to take these mappings into account when counting the number of buttons on the device. Example: A device with BTN_LEFT and BTN_0 and a mapping from 1 -> 7 and 8 -> 2. BTN_LEFT is mapped to 1. 1 is mapped to 7. num_buttons is 7. BTN_0 is mapped to 8. 8 is mapped to 2. num_buttons remains 7. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit b358f1eb3a4ef8fdee099114d6c70d6ea06eba95) diff --git a/src/evdev.c b/src/evdev.c index 80ba276..a9e1d27 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1466,8 +1466,14 @@ EvdevProbe(InputInfoPtr pInfo) /* count all buttons */ for (i = BTN_MISC; i < BTN_JOYSTICK; i++) { + int mapping = 0; if (TestBit(i, pEvdev->key_bitmask)) - num_buttons++; + { + mapping = + pEvdev->btnmap[EvdevUtilButtonEventToButtonNumber(pEvdev, i)]; + if (mapping > num_buttons) + num_buttons = mapping; + } } if (num_buttons) commit 6d43a45b99e07325c74cbe1d20b04094ba99950d Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed May 20 11:47:37 2009 +1000 Up the number of button labels atoms to EVDEV_MAXBUTTONS. Button labels would smash memory if the device had less than 4 buttons and did not advertise a wheel event. In this case the hard-coded wheel button labels would write past the atoms[] boundary. Potential memory smash if a device had a BTN_LEFT and BTN_0, since the latter would map to 8, regardless of the the number of actual buttons (same with BTN_MIDDLE and BTN_1 or BTN_RIGHT and BTN_2). Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit 33cc112ca1af377a85cfeb05dfb72f07d3850a95) diff --git a/src/evdev.c b/src/evdev.c index fc4832b..80ba276 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2028,12 +2028,12 @@ EvdevInitProperty(DeviceIntPtr dev) /* Button labelling */ if ((pEvdev->buttons > 0) && (prop_btn_label = XIGetKnownProperty(BTN_LABEL_PROP))) { - Atom atom, atoms[pEvdev->buttons]; + Atom atom, atoms[EVDEV_MAXBUTTONS]; int button, bmap; /* First, make sure all atoms are initialized */ atom = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN); - for (button = 0; button < pEvdev->buttons; button++) + for (button = 0; button < ArrayLength(atoms); button++) atoms[button] = atom; for (button = BTN_MISC; button < BTN_JOYSTICK; button++) commit 40d3ad3ac00fc21f2561c906d1246648a9f74087 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed May 20 11:42:35 2009 +1000 Only label axes and buttons if the device has axes or buttons. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> (cherry picked from commit 3c43d880f13725a04fcd7c0c8d5978a36208e373) diff --git a/src/evdev.c b/src/evdev.c index 9fc0663..fc4832b 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1982,7 +1982,7 @@ EvdevInitProperty(DeviceIntPtr dev) #ifdef HAVE_LABELS /* Axis labelling */ - if ((prop_axis_label = XIGetKnownProperty(AXIS_LABEL_PROP))) + if ((pEvdev->num_vals > 0) && (prop_axis_label = XIGetKnownProperty(AXIS_LABEL_PROP))) { Atom atom, atoms[pEvdev->num_vals]; int natoms = pEvdev->num_vals; @@ -2026,7 +2026,7 @@ EvdevInitProperty(DeviceIntPtr dev) XISetDevicePropertyDeletable(dev, prop_axis_label, FALSE); } /* Button labelling */ - if ((prop_btn_label = XIGetKnownProperty(BTN_LABEL_PROP))) + if ((pEvdev->buttons > 0) && (prop_btn_label = XIGetKnownProperty(BTN_LABEL_PROP))) { Atom atom, atoms[pEvdev->buttons]; int button, bmap; -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org