Peter Hutterer [Thu, 2 Jul 2015 03:06:18 +0000 (13:06 +1000)]
Merge branch 'drop-pointer-normalization'
Peter Hutterer [Tue, 23 Jun 2015 02:45:16 +0000 (12:45 +1000)]
filter: add a custom low-dpi acceleration
Motion normalization does not work well for devices below the default 1000dpi
rate. A 400dpi mouse's minimum movement generates a 2.5 normalized motion,
causing it to skip pixels at low speeds even when unaccelerated.
Likewise, we don't want 1000dpi mice to be normalized to a 400dpi mouse, it
feels sluggish even at higher acceleration speeds.
Instead, add a custom acceleration method for lower-dpi mice. At low-speeds,
one device unit results in a one-pixel movement. Depending on the DPI factor,
the acceleration kicks in earlier and goes to higher acceleration so faster
movements with a low-dpi mouse feel approximately the same as the same
movement on a higher-dpi mouse.
https://bugzilla.redhat.com/show_bug.cgi?id=1231304
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 19 Jun 2015 06:19:27 +0000 (16:19 +1000)]
tools: add --dpi= arg to ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 19 Jun 2015 06:03:42 +0000 (16:03 +1000)]
filter: pass the DPI to the acceleration filter
Currently unused, but store the ratio of DPI:default DPI for later use.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 26 Jun 2015 01:06:05 +0000 (11:06 +1000)]
test: add a low-dpi mouse test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 25 Jun 2015 23:07:24 +0000 (09:07 +1000)]
Drop motion normalization of unaccelerated deltas
This simply doesn't work for low-dpi mice. Normalizing a 400dpi mouse to a
1000dpi mouse forces a minimum movement of 2.5 units and the resulting pixel
jumps. It is impossible for the caller to detect whether the jump was caused
by a single motion or multiple motion events.
This is technically an API break, but not really.
The accelerated data was already relatively meaningless, even if normalized as
the data did not correspond predictably to any input motion (unless you know
the implementation acceleration function in the caller). So we can drop the
mention from there without expecting any ill effects in the caller.
The unaccelerated data was useless for low-dpi mice and could only be used to
measure the physical distance of the mouse movement - something not used in
any caller we're aware of (if needed, we can add that functionality as a
separate call). Dropping motion normalization for unaccelerated deltas also
restores true dpi capabilities to users of that API, mostly games that want to
make use of high-dpi mice.
This is a simplified patch, the normalization is still in place for most of
libinput, it merely carries the original coordinates in the event itself.
In the case of touchpads, the coordinates are unnormalized into the x-axis
coordinate space as per the documentation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 12 Jun 2015 05:31:56 +0000 (15:31 +1000)]
filter: reduce deceleration to minimal speeds only
Deceleration at low speeds is intended to enhance precision when moving the
pointer slowly. However, the adaptive deceleration we used was badly
calibrated, at slow-but-normal speeds the pointer became too slow to manouver.
We don't want to drop deceleration completely, the subpixel precision it
provides is useful. And it also helps those that can't move a 1000dpi mouse by
exactly one unit.
Make the adaptive deceleration steeper so it only kicks in at extremely slow
motions and defaults to 1 at anything resembling normal movement (i.e. pointer
moves like the physical device does).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 30 Jun 2015 23:33:51 +0000 (09:33 +1000)]
udev: make a note that hwdb matches are exclusive
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 1 Jul 2015 00:55:23 +0000 (10:55 +1000)]
test: add the warning to the rules file too
The rules file in /run may be left over after an unclean exit and mess with
things.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2015 01:41:47 +0000 (11:41 +1000)]
touchpad: disable trackpoint palm detection on small touchpads
Tested on three laptops here, Lenovo T61, X220 and an HP EliteBook (?), all
with small touchpads. It's hard to have a hand position where the palm touches
the touchpad while using the trackpoint. So we might as well save us the
effort of monitoring events and enabling/disabling it on demand.
As a side-effect this fixes 1233844, but that's more a coincidence.
https://bugzilla.redhat.com/show_bug.cgi?id=1233844
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 23 Jun 2015 05:36:05 +0000 (15:36 +1000)]
touchpad: improve trackpoint palm detection responsiveness
The touchpad is disabled for 500ms after a trackpoint event to avoid
erroneous palm touches. This is currently refreshed on every trackpoint event
and thus forces a delay of 500ms when switching between the two.
Instead, reduce the timeout to 300ms but ignore any touches started while the
trackpoint was active (i.e. before the last trackpoint event). A touch started
after the last event is released once the timeout expires.
This is the same logic used for disable-while-typing.
https://bugzilla.redhat.com/show_bug.cgi?id=1233844
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 24 Jun 2015 00:57:07 +0000 (10:57 +1000)]
touchpad: always set touch->palm.time on touch begin
We will use this outside of DWT, so set it unconditionally on touch begin.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 24 Jun 2015 01:22:29 +0000 (11:22 +1000)]
touchpad: move trackpoint timer stuff into the palm struct
No functional changes, just rearranging where it fits better.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 30 Jun 2015 22:54:32 +0000 (08:54 +1000)]
test: increase the udev init timeout
Hitting this limit too often on congested VMs, so let's increase the sleep
sleep (so the system can get done what needs to be done) and get the whole
timeout from 600ms to 2000ms.
Note: if we really hit 2000ms we may still fail on some tests with the check's
default 3 second timeout.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 30 Jun 2015 02:03:28 +0000 (12:03 +1000)]
evdev: evdev_fix_abs_resolution can be static
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 30 Jun 2015 01:40:46 +0000 (11:40 +1000)]
test: group the parser tests together
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 29 Jun 2015 23:57:13 +0000 (09:57 +1000)]
Add missing copyright header to the udev callout
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 26 Jun 2015 06:18:29 +0000 (16:18 +1000)]
touchpad: disable tap drag lock by default
Similar to tapping, it's a feature that is useful but confusing if a user
doesn't know it exists. It makes the touchpad appear laggy and slow to react
in the best case, or appear like a stuck button in the worst case.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 25 Jun 2015 01:03:09 +0000 (11:03 +1000)]
Add missing @ingroup tag to the logging priority enum
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 23 Jun 2015 02:45:55 +0000 (12:45 +1000)]
filter: use a tmp variable for the accel factor
No real effect, just makes the diff for debugging printfs smaller.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 26 Jun 2015 00:00:24 +0000 (10:00 +1000)]
tools: don't drop the accelerated deltas in ptraccel-debug
Leftover from the initial (out-of-tree) implementation where we updated motion
in place. That hasn't been true since libinput switched to type-safe
coordinates.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 25 Jun 2015 23:27:20 +0000 (09:27 +1000)]
evdev: move posting a trackpoint scroll event into a helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 23 Jun 2015 02:41:57 +0000 (12:41 +1000)]
evdev: log device's DPI setting if any
Makes debugging things easier.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 19 Jun 2015 06:01:34 +0000 (16:01 +1000)]
evdev: read dpi before evdev_configure_device
So we can use to set up accel during evdev_configure_device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 25 Jun 2015 04:10:38 +0000 (14:10 +1000)]
evdev: store the device dimensions
We use width/height often enough that storing it once is better than
calculating it on each event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Gilles Dartiguelongue [Tue, 23 Jun 2015 09:31:56 +0000 (11:31 +0200)]
Add missing includes for *stat
Signed-off-by: Gilles Dartiguelongue <eva@gentoo.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2015 05:30:59 +0000 (15:30 +1000)]
Add a debug_trace() macro for easier debugging
Disabled by default, define DEBUG_TRACE when needed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 25 Jun 2015 02:20:04 +0000 (12:20 +1000)]
touchpad: fix stuck finger after a click
On a touchpad without resolution, the pinned finger was stuck. The motion
distance scale factor ended up as 0 and the finger never reached the threshold
of 3mm.
int was not the best choice of datatype for a value of 0.007...
Fix the data types for xdist/ydist at the same time, clamping to int may cause
erroneous (un)pinning.
Introduced in
8025b374d564f4a30b089e5cf6fd65e0c6af8da2
https://bugs.freedesktop.org/show_bug.cgi?id=91070
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2015 05:12:54 +0000 (15:12 +1000)]
tools: add --grab option
Issues an EVIOCGRAB on the openend devices, providing exclusive access. Makes
it easier for debugging, so moving the pointer doesn't accidentally trigger
other stuff.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2015 05:07:53 +0000 (15:07 +1000)]
tools: pass a context around as userdata
We need the options during open_restricted(), so instead of the caller just
passing in a custom userdata, let them wrap it into a tools_context.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2015 04:52:48 +0000 (14:52 +1000)]
tools: move the interface into the shared code
No need to duplicate this atm
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2015 04:46:53 +0000 (14:46 +1000)]
tools: remove obsolete comments
With the OPT_foo enums, these comments aren't necessary anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 24 Jun 2015 01:00:52 +0000 (11:00 +1000)]
Fix an indentation issue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 19 Jun 2015 00:11:13 +0000 (10:11 +1000)]
touchpad: reduce edge scroll motion threshold to 3mm
Reduce the dead zone/initial jump
https://bugs.freedesktop.org/show_bug.cgi?id=90990
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 18 Jun 2015 23:21:58 +0000 (09:21 +1000)]
touchpad: only send most recent edge delta when triggering threshold
When edge scrolling is triggered by exceeding the motion threshold (5mm) we
sent the whole delta as the first scroll event, causing a big jump.
Instead, send only the current delta. This effectively introduces a 5mm dead
zone when edge scrolling, still better than the jump.
https://bugs.freedesktop.org/show_bug.cgi?id=90990
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 17 Jun 2015 00:59:21 +0000 (10:59 +1000)]
test: add non-draglock test and rename draglock-dependent tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 22 Jun 2015 01:07:31 +0000 (11:07 +1000)]
tools: hook up drag lock config
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 22 Jun 2015 01:06:25 +0000 (11:06 +1000)]
touchpad: hook up drag lock configuration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 16 Jun 2015 07:02:02 +0000 (17:02 +1000)]
Add configuration interface for tap drag-lock
In some applications, notably Inkscape, where it is common to frequently drag
objects a short distance the default to drag-lock always-on is frustrating for
users.
Make it configurable, with the current default to "on".
New API:
libinput_device_config_tap_set_drag_lock_enabled
libinput_device_config_tap_get_drag_lock_enabled
libinput_device_config_tap_get_default_drag_lock_enabled
Any device capable of tapping is capable of drag lock, there is no explicit
availability check for drag lock. Configuration is independent, drag lock may
be enabled when tapping is disabled.
In the tests, enable/disable drag-lock explicitly where the tests depend
on it.
https://bugs.freedesktop.org/show_bug.cgi?id=90928
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 17 Jun 2015 00:02:17 +0000 (10:02 +1000)]
test: replace tap config with helper function
No functional change, other than that we check for status codes now too.
In tests that don't specifically check the interface itself, a short
enable_tap() or disable_tap() is a lot more obvious to parse for the reader.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 9 Apr 2015 06:08:14 +0000 (16:08 +1000)]
udev: prepend the libinput group with the product string
Multiple devices plugged into the same USB hub have the same
PHYS path and are assigned to the same group.
Prepend the content of the PRODUCT env to the phys path, this at least ensures
that different devices are never grouped together.
https://bugs.freedesktop.org/show_bug.cgi?id=89802
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 22 Jun 2015 21:45:36 +0000 (07:45 +1000)]
Extend CODING_STYLE with the if/else requirements
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 19 Jun 2015 06:07:10 +0000 (16:07 +1000)]
tools: drop superfluous linebreaks in ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Jun 2015 02:21:28 +0000 (12:21 +1000)]
configure.ac: libinput 0.18.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 21 Jun 2015 23:28:06 +0000 (09:28 +1000)]
test: drop extra finger up/down in tapndrag + click test
Already tested elsewhere
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 22 Jun 2015 00:16:28 +0000 (10:16 +1000)]
tools: drop some superfluous parenthesis
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 15 Jun 2015 04:37:49 +0000 (14:37 +1000)]
touchpad: mark ALPS touchpads for middle button emulation
Alps devices don't know if there is a physical middle button on the touchpad,
so they always report one.
Since a large number of touchpads only have two buttons, enable middle button
emulation by default. Those that really don't want it can play with
configuration options, everyone else has it working by default.
The hwdb entry uses "*Alps ..*" as name to also trigger the "litest Alps..."
devices.
https://bugzilla.redhat.com/show_bug.cgi?id=1227992
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 16 Jun 2015 05:36:40 +0000 (15:36 +1000)]
test: add ALPS DualPoint device
Same as the existing GlidePoint semi-mt device, but this one has a x/y
resolution.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 16 Jun 2015 05:39:48 +0000 (15:39 +1000)]
touchpad: disable right-edge palm detection for edge scrolling
Most scroll motions would be labelled a palm.
https://bugs.freedesktop.org/show_bug.cgi?id=90980
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 19 Jun 2015 04:58:16 +0000 (14:58 +1000)]
test: move tapping tests into a separate binary
The previous set hit _some_ sort of limit, but no idea what or why. When
adding one more test, the touchpad test case would reliably fail with a udev
timeout in litest_wait_for_udev(). This only happened in the valgrind case,
the normal run succeeded. Reproduced on three different installations (2 vms
on two different hosts).
Move the tapping tests into a separate binary, this unwedges whatever was
unhappy and sunshine, lollipops and rainbows are distributed generously.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 17 Jun 2015 00:50:10 +0000 (10:50 +1000)]
test: switch clickpad multitap to a ranged test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 18 Jun 2015 03:18:16 +0000 (13:18 +1000)]
test: fix missing range value when the first test case is a ranged one
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 17 Jun 2015 01:21:23 +0000 (11:21 +1000)]
test: replace two asserts with litest_asserts
Having a backtrace is nice
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 16 Jun 2015 06:52:48 +0000 (16:52 +1000)]
Fix documentation for tap_get_enabled()
Technically we return LIBINPUT_CONFIG_TAP_DISABLED, which is 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 11 Jun 2015 02:09:18 +0000 (12:09 +1000)]
COPYING: Update boilerplate from MIT X11 to MIT Expat license
To quote Bryce Harrington from [1]:
"MIT has released software under several slightly different licenses,
including the old 'X11 License' or 'MIT License'. Some code under this
license was in fact included in X.org's Xserver in the past. However,
X.org now prefers the MIT Expat License as the standard (which,
confusingly, is also referred to as the 'MIT License'). See
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
When Wayland started, it was Kristian Høgsberg's intent to license it
compatibly with X.org. "I wanted Wayland to be usable (license-wise)
whereever X was usable." But, the text of the older X11 License was
taken for Wayland, rather than X11's current standard. This patch
corrects this by swapping in the intended text."
libinput is a fork of weston and thus inherited the original license intent
and the license boilerplate itself.
See this thread on wayland-devel here for a discussion:
http://lists.freedesktop.org/archives/wayland-devel/2015-May/022301.html
[1] http://lists.freedesktop.org/archives/wayland-devel/2015-June/022552.html
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Jonas Ã…dahl <jadahl@gmail.com>
Peter Hutterer [Fri, 12 Jun 2015 07:29:41 +0000 (17:29 +1000)]
touchpad: set the finger pin distance to 5mm where possible
On touchpads with resolutions, use a 5mm motion threshold before we unpin the
finger (allow motion events while a clickpad button is down). This should
remove any erroneous finger movements while clicking, at the cost of having to
move the finger a bit more for a single-finger click-and-drag (use two fingers
already!)
And drop the finger drifting, it was per-event based rather than time-based.
So unless the motion threshold was hit in a single event it was possible to
move the finger around the whole touchpad without ever unpinning it.
Drop the finger drifting altogether, if the touchpad drifts by more than 5mm
we have other issues.
https://bugzilla.redhat.com/show_bug.cgi?id=1230462
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 12 Jun 2015 07:24:33 +0000 (17:24 +1000)]
touchpad: fix pinned finger drifting
This caused the finger to be unpinned on the first motion event after the
click, effectively disabling this feature.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 15 Jun 2015 04:12:09 +0000 (14:12 +1000)]
udev: drop erroneous trailing colon from dmi matches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 11 Jun 2015 06:31:00 +0000 (16:31 +1000)]
touchpad: make the hysteresis dependent on physical distance
Some touchpads, e.g. the Cyapa in the Acer c720 have a small axis range
([0, 870], [0, 470]), so the diagonal/magic value yields a hysteresis margin
of 1 device unit. On that device, that's one-tenth of a millimeter, causing
pointer motion just by holding the finger.
For touchpads that provide a physical resolution, set the hysteresis axes to
0.5mm and do away with the magic factor.
https://bugzilla.redhat.com/show_bug.cgi?id=1230441
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 5 Jun 2015 06:17:04 +0000 (16:17 +1000)]
Move Wacom touchpad tagging to the udev rules
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 5 Jun 2015 00:13:56 +0000 (10:13 +1000)]
Move apple touchpad tagging to the udev rules
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 5 Jun 2015 00:52:04 +0000 (10:52 +1000)]
test: always install our own udev rule/hwdb files for tests
We can't rely on the system having these files installed, at least not in the
latest version that we'd like.
Copy them over from the source directory into the /run/ and /etc/ directories
for each test and update udev and the hwdb. This ensures the tags we set in
the hwdb file are always set, regardless of the system configuration.
Note that the /run/udev/* files need to have a different filename to the ones
we ship to avoid getting overridden by local configuration.
systemd does not have support for /run/udev/hwdb.d [1]. So our hwdb.d file
is in /etc/udev/hwdb.d instead and marked them with a REMOVEME and a comment
that if that file is left after the tests, it should be removed by the user.
[1] https://github.com/systemd/systemd/issues/127
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
JoonCheol Park [Thu, 11 Jun 2015 07:38:02 +0000 (16:38 +0900)]
test: add missing libunwind cflags to test-litest-selftest
Signed-off-by: JoonCheol Park <jooncheol@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 8 Jun 2015 22:06:20 +0000 (08:06 +1000)]
filter: require minimum acceleration factor of 0.3
For really slow motions, the previous acceleration factor would go down to
effectively zero. So the slower the mouse motion was, the more it would be
slowed down which made the mouse at low speeds almost unusable.
Cap the minimum acceleration at 0.3 which provides a predictable slow motion
for the cursor when high precision is required.
New/old acceleration functions comparison:
^
| /
| /
ty| _________/
| / /
| / /
| / /
|/ / <----- new minimum accel factor
| /
|/___________________>
tx
i.e. the general shape is maintained, but it doesn't go to zero anymore. The
functions aren't parallel, the new shape is slightly flatter than the previous
one and they meet at the point where the functions flatten for the threshold
(tx/ty). ascii art has its limits...
https://bugzilla.redhat.com/show_bug.cgi?id=1227039
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 9 Jun 2015 23:54:06 +0000 (09:54 +1000)]
touchpad: restart the motion filter on touch begin
Our motion filter takes the last couple of vectors to calculate speed,
provided the direction stays the same and it is within a certain timeout. It
does not take into account lifting the finger, so the velocity on the first
event is off.
Real-world impact is mainly on scrolling. Before commit
289e4675
filter: enforce minimum velocity
the first motion on a scroll was accelerated by a factor of 0 and swallowed.
After
289e4675 the motion was calculated based on the timeout and a fraction
of the expected effect. Now the first scroll motion is based on the real
finger motion since setting the finger down and thus feels a bit more
responsive.
It also makes a couple of test cases using litest_assert_scroll() work again
since the miniumum motion is now as expected.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 9 Jun 2015 21:56:57 +0000 (07:56 +1000)]
doc: make horizontal scrolling a separate section
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Jun 2015 21:52:52 +0000 (07:52 +1000)]
doc: provide an outline of which scroll method is available where
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Jun 2015 21:45:39 +0000 (07:45 +1000)]
doc: add a note that middle-button dragging is not possible on sticks
Just to have something to point bug reporters to.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 5 Jun 2015 01:40:26 +0000 (11:40 +1000)]
test: fix litest_log() when libunwind is missing
Previous expansion had side-effects when litest_log was called in an if
condition without {}
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 5 Jun 2015 00:39:30 +0000 (10:39 +1000)]
test: replace a strncmp call with strneq
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 5 Jun 2015 00:10:56 +0000 (10:10 +1000)]
touchpad: fix whitespace issue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jun 2015 00:20:25 +0000 (10:20 +1000)]
configure.ac: libinput 0.17.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Jun 2015 04:27:43 +0000 (14:27 +1000)]
touchpad: on non-resolution touchpads, use 30% as maximum clickfinger spread
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 3 Jun 2015 02:15:51 +0000 (12:15 +1000)]
touchpad: impose maximum distance limits on clickfingers
A common use-case for clickfinger is to use the index finger for moving the
pointer, then triggering the click with a thumb. If the index finger isn't
lifted before the click this counted as two-finger click.
To avoid this, check the distance between touches on the touchpad (on
touchpads reporting resolution values anyway). If the touches are too far
apart, don't count them together (or specifically only count those close
enough together as multi-finger).
The touch area is uneven, it's wider than high. Spreading fingers horizontally
is more common and this also makes it easier to rule out thumbs which tend to
be well below the fingers.
http://bugs.freedesktop.org/show_bug.cgi?id=90526
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 3 Jun 2015 01:06:54 +0000 (11:06 +1000)]
touchpad: move clickfinger finger decision into a helper function
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 3 Jun 2015 01:30:11 +0000 (11:30 +1000)]
touchpad: replace hardcoded resolution > 1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Benjamin Tissoires [Tue, 2 Jun 2015 21:22:42 +0000 (17:22 -0400)]
evdev: remove direct checks for INPUT_PROP_POINTING_STICK
If we need to temporary override a device with ID_INPUT_POINTINGSTICK,
evdev sets the tag EVDEV_TAG_TRACKPOINT to the device. Rely on the tag
to behave properly for scroll emulation.
The dpi information should be retrieved after the device has been
configured or the tag EVDEV_TAG_TRACKPOINT was not set.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Benjamin Tissoires [Tue, 2 Jun 2015 21:22:41 +0000 (17:22 -0400)]
evdev: remove tag_device from evdev_dispatch_interface
Tagging a device should occur only once during configure. We do not
have devices that can be changed after they are configured, so there is no
point in having the tagging part in a deferred struct.
Plus, the note saying that we tag with only one of EVDEV_TAG was wrong.
Now that we are chosing when we call each evdev_tag_*, we can also get
rid of the device->seat_caps tests.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Jun 2015 06:32:41 +0000 (16:32 +1000)]
evdev: always default to the middle button for button-scrolling
The current code only defaulted to the middle button for those devices that
used button scrolling by default, requiring the user to enable button
scrolling _and_ set the button before it is active. This causes some
confusion.
There is no real benefit to leaving the button at 0 when the scroll
method isn't enabled anyway. So always default to the middle button (if
available).
https://bugzilla.redhat.com/show_bug.cgi?id=1227182
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 2 Jun 2015 05:45:37 +0000 (15:45 +1000)]
doc: add a graphic to explain tap-n-drag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Jun 2015 03:04:44 +0000 (13:04 +1000)]
touchpad: reduce tap-n-drag timeout to 300ms
The current 500ms is too long, reduce it to 300ms instead. This is still long
enough to get multiple movements but not that long that it feels like the
button is stuck.
https://bugs.freedesktop.org/show_bug.cgi?id=90613
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Tue, 2 Jun 2015 01:04:59 +0000 (18:04 -0700)]
test: check getcwd() and system() return values in litest
Added code to check for errors in getcwd() and system() that
were previously ignored and silently dropped.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jun 2015 23:53:00 +0000 (09:53 +1000)]
Add a CODING_STYLE document
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 22 Apr 2015 02:25:13 +0000 (12:25 +1000)]
filter: enforce minimum velocity
In the current code, a timeout or direction change on the first tracker will
result in a velocity of 0. Really slow movements will thus always be zero, and
the first event after a direction is swallowed.
Enforce a minimum velocity:
In the case of a timeout, assume the current velocity is that of
distance/timeout. In the case of a direction change, the velocity is simply
that since the last tracker.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 22 Apr 2015 01:46:57 +0000 (11:46 +1000)]
filter: up the motion timeout to 1 second
This timeout defines how far back in the events we search for velocity
calculations. For really slow movements, 300ms is not enough. It causes the
velocity to be 0 -> accel factor of 0 -> no movement.
As a result, really slow movement does not move the cursor.
Up the timeout to 1 second instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 30 Apr 2015 05:23:34 +0000 (15:23 +1000)]
filter: pass last_velocity as argument
Let the caller set the various fields, here we just calculate stuff.
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 1 Jun 2015 04:38:29 +0000 (14:38 +1000)]
evdev: use the button down time for no-scroll middle button press event
When we get the release event within the timeout, we send a press + release
event for the middle button. Rather than using the release event's timestamp
for both, remember and use the button press timestamp.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 1 Jun 2015 06:58:37 +0000 (16:58 +1000)]
configure.ac: libinput 0.16.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:57:18 +0000 (08:57 +1000)]
doc: add a FAQ page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 23:33:07 +0000 (09:33 +1000)]
README: add two diagrams to outline the stack
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:12:33 +0000 (08:12 +1000)]
COPYING: note that having linux/input.h in the tree does not make libinput GPL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Sat, 30 May 2015 01:40:25 +0000 (18:40 -0700)]
test: address gcc warnings on potentially uninitialized variables.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Fri, 29 May 2015 02:01:01 +0000 (19:01 -0700)]
Add xasprintf to avoid use of undefined pointer values
If asprintf fails for any reason, the contents of the pointer
are undefined. While some platforms set it to NULL, there is no
guarantee that all will.
This change adds a simple wrapper to ensure proper NULL results
on failure.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Added LIBINPUT_PRINTF attribute and the required declaration for it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Sun, 31 May 2015 22:09:26 +0000 (08:09 +1000)]
Add missing config.h includes
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 29 May 2015 01:11:56 +0000 (11:11 +1000)]
evdev: use the udev ID_INPUT_POINTINGSTICK property
Added in systemd 220, but note that for udev backwards compatibility, the
ID_INPUT_POINTINGSTICK tag is set in addition to the ID_INPUT_MOUSE tag.
And use that property to tag a device as trackpoint too, this allows temporary
workarounds for kernel bugs where the input prop isn't set yet.
https://bugzilla.redhat.com/show_bug.cgi?id=1225563
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 28 May 2015 21:29:07 +0000 (07:29 +1000)]
test: add another wait loop for udev
Wait after deleting a device so udev can catch up with everything and the
various hooks to make sure it's happy with any newly created devices after
this.
The sleep is in the delete path to also cover the tests where we manually
create uinput devices rather than using the litest hooks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 28 May 2015 03:41:58 +0000 (13:41 +1000)]
touchpad: check touchpad for basic features we expect
If a relative device is tagged by udev as ID_INPUT_TOUCHPAD we need to
catch this before we try to dereference device->abs.absinfo_x.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 29 May 2015 02:13:02 +0000 (12:13 +1000)]
tools: print symbolic key names too from event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 28 May 2015 03:33:54 +0000 (13:33 +1000)]
test: don't abort if the device filter filtered all devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:04:42 +0000 (08:04 +1000)]
README: spice up the readme a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>