platform/upstream/libinput.git
9 years agolitest: add a generic multitouch screen
Andreas Pokorny [Mon, 6 Jul 2015 15:05:02 +0000 (17:05 +0200)]
litest: add a generic multitouch screen

Adds a device with various touch related axes and respective device features
to litest.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agolitest: add axis_replacement from tablet branch
Andreas Pokorny [Mon, 22 Jun 2015 10:48:04 +0000 (12:48 +0200)]
litest: add axis_replacement from tablet branch

This change adds strict axis_replacement and litest_touch_move_extended
and litest_touch_down_extended to simulate changes to other axes during
touch down and move events.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: add "mouse is too fast" to the FAQ
Peter Hutterer [Mon, 6 Jul 2015 21:41:03 +0000 (07:41 +1000)]
doc: add "mouse is too fast" to the FAQ

And reference libevdev's mouse-dpi-tool while we're at it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools: don't call is_cancelled on a gesture begin event
Peter Hutterer [Mon, 6 Jul 2015 05:05:32 +0000 (15:05 +1000)]
tools: don't call is_cancelled on a gesture begin event

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: correct a comment
Peter Hutterer [Fri, 3 Jul 2015 00:34:17 +0000 (10:34 +1000)]
touchpad: correct a comment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMerge branch 'touchpad-gestures'
Peter Hutterer [Mon, 6 Jul 2015 04:11:38 +0000 (14:11 +1000)]
Merge branch 'touchpad-gestures'

9 years agolibinput.sym: make the touchpad gestures part of the 0.20 API
Peter Hutterer [Mon, 6 Jul 2015 04:10:48 +0000 (14:10 +1000)]
libinput.sym: make the touchpad gestures part of the 0.20 API

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: add documentation for touchpad gestures
Peter Hutterer [Thu, 11 Jun 2015 00:45:22 +0000 (10:45 +1000)]
doc: add documentation for touchpad gestures

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools: handle pinch event in event-gui
Peter Hutterer [Fri, 22 May 2015 01:14:41 +0000 (11:14 +1000)]
tools: handle pinch event in event-gui

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotools: add swipe support to the event-gui
Peter Hutterer [Fri, 22 May 2015 00:40:16 +0000 (10:40 +1000)]
tools: add swipe support to the event-gui

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agogestures: allow any gesture event type for gesture_get_dx/dy and get_angle
Peter Hutterer [Tue, 9 Jun 2015 04:23:07 +0000 (14:23 +1000)]
gestures: allow any gesture event type for gesture_get_dx/dy and get_angle

For start/end, dx/dy is always 0.0, and there is no need to make calling this
function for start/end a caller bug. It just unnecessarily complicates the
caller's codepath.

Same for get_angle

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agogestures: check for valid types on the gesture event API
Peter Hutterer [Fri, 22 May 2015 00:58:56 +0000 (10:58 +1000)]
gestures: check for valid types on the gesture event API

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: split tp_gesture_stop into stop and cancel
Peter Hutterer [Fri, 22 May 2015 00:09:22 +0000 (10:09 +1000)]
touchpad: split tp_gesture_stop into stop and cancel

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: Allow querying whether a gesture ended normally or was cancelled
Hans de Goede [Wed, 29 Apr 2015 11:19:51 +0000 (13:19 +0200)]
touchpad: Allow querying whether a gesture ended normally or was cancelled

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: Implement pinch gesture support
Hans de Goede [Thu, 5 Mar 2015 11:44:13 +0000 (12:44 +0100)]
touchpad: Implement pinch gesture support

Implement touchpad pinch (and rotate) gesture support.

Note that two two-finger scrolling tests are slightly tweaked to assure that
there is enough touch movement to allow the scroll-or-pinch detect code to do
its work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
9 years agotouchpad: Extend the touchpad gesture API with pinch gestures
Hans de Goede [Wed, 4 Mar 2015 14:24:04 +0000 (15:24 +0100)]
touchpad: Extend the touchpad gesture API with pinch gestures

Extend the touchpad gesture API with pinch gestures. Note that this
new API offers a single event stream for both pinch and rotate data, this
is deliberate as some applications may be interested in getting both at
the same time. Applications which are only interested in one or the other
can simply ignore the other.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
9 years agotouchpad: Add support for swipe gestures
Hans de Goede [Wed, 18 Feb 2015 08:00:25 +0000 (09:00 +0100)]
touchpad: Add support for swipe gestures

Add support for swipe gestures.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
9 years agotouchpad: Add an API for touchpad gesture events
Hans de Goede [Thu, 22 Jan 2015 15:41:50 +0000 (16:41 +0100)]
touchpad: Add an API for touchpad gesture events

For touchscreens we always send raw touch events to the compositor, and the
compositor or application toolkits do gesture recognition. This makes sense
because on a touchscreen which window / widget the touches are over is
important context to know to interpret gestures.

On touchpads however we never send raw events since a touchpad is an absolute
device which primary function is to send pointer motion delta-s, so we always
need to do processing (and a lot of it) on the raw events.

Moreover there is nothing underneath the finger which influences how to
interpret gestures, and there is a lot of touchpad and libinput configuration
specific context necessary for gesture recognition. E.g. is this a clickpad,
and if so are softbuttons or clickfinger used? What is the size of the
softbuttons? Is this a true multi-touch touchpad or a semi multi-touch touchpad
which only gives us a bounding box enclosing the fingers? Etc.

So for touchpads it is better to do gesture processing in libinput, this commit
adds an initial implementation of a Gesture event API which only supports swipe
gestures, other gestures will be added later following the same model wrt,
having clear start and stop events and the number of fingers involved being
fixed once a gesture sequence starts.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
9 years agoconfigure.ac: libinput 0.19.0 0.19.0
Peter Hutterer [Mon, 6 Jul 2015 00:21:59 +0000 (10:21 +1000)]
configure.ac: libinput 0.19.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: initialize syspath
Peter Hutterer [Mon, 6 Jul 2015 01:37:46 +0000 (11:37 +1000)]
test: initialize syspath

When the condition with continue was hit, syspath was still compared in the
loop condition, leading to crashes when strcmp()-ing a random string.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoAdd missing "global" tag to the 0.19 symbol block
Peter Hutterer [Mon, 6 Jul 2015 01:22:34 +0000 (11:22 +1000)]
Add missing "global" tag to the 0.19 symbol block

Not required, but for consistency.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add a test for 0/0 relative motion events
Peter Hutterer [Thu, 2 Jul 2015 23:09:16 +0000 (09:09 +1000)]
test: add a test for 0/0 relative motion events

This test doesn't really test for that because the kernel shouldn't forward
these events to us in the first place. It's merely a canary to warn us if this
ever changes and we end up not ignoring the events.

The test is only run for one device (the default mouse), no need to waste more
time on this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add a test for minimum motion movement
Peter Hutterer [Thu, 2 Jul 2015 22:43:27 +0000 (08:43 +1000)]
test: add a test for minimum motion movement

The first motion on a device must have the mimimum movement factor (0.3)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: send a single motion event for relative tests only
Peter Hutterer [Thu, 2 Jul 2015 22:26:04 +0000 (08:26 +1000)]
test: send a single motion event for relative tests only

Since 69449ca854, the minimum deceleration is 0.3 and we don't get a 0 motion
event anymore. We can drop the helper function now too.

What we do in that test instead is pump one relative motion event through
before we start comparing the events, this way our second, third, .. events
will have some acceleration applied and the tests compare more accurate
values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add some tests for udev tagging
Peter Hutterer [Thu, 2 Jul 2015 22:13:24 +0000 (08:13 +1000)]
test: add some tests for udev tagging

We can't easily test for DMI matches, but anything that hooks onto pid/vid is
easy to verify for correctness.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: use poll instead of a busy wait
Peter Hutterer [Thu, 2 Jul 2015 04:22:05 +0000 (14:22 +1000)]
test: use poll instead of a busy wait

Drop the busy loop we had waiting for an event to appear and just call poll on
the libinput fd.

This actually makes the tests more correct, if we now time out where we didn't
before it means we're not setting the timers correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: up the default test timeout to 10s
Peter Hutterer [Thu, 2 Jul 2015 04:21:45 +0000 (14:21 +1000)]
test: up the default test timeout to 10s

3s is too easy to hit on congested systems. 10s is overkill, but it's still
better to pass a test late than having to restart the whole test-suite again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: wait for the uinput_monitor on test devices
Peter Hutterer [Thu, 2 Jul 2015 03:39:40 +0000 (13:39 +1000)]
test: wait for the uinput_monitor on test devices

Set up a udev_monitor before each device creation and wait for the monitor to
notify us of the newly created device. This should take the place of the
various sleep loops  we currently have sprinkled around the code and provide a
reliability when testing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoMerge branch 'drop-pointer-normalization'
Peter Hutterer [Thu, 2 Jul 2015 03:06:18 +0000 (13:06 +1000)]
Merge branch 'drop-pointer-normalization'

9 years agofilter: add a custom low-dpi acceleration
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>
9 years agotools: add --dpi= arg to ptraccel-debug
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>
9 years agofilter: pass the DPI to the acceleration filter
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>
9 years agotest: add a low-dpi mouse test device
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>
9 years agoDrop motion normalization of unaccelerated deltas
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>
9 years agofilter: reduce deceleration to minimal speeds only
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>
9 years agoudev: make a note that hwdb matches are exclusive
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>
9 years agotest: add the warning to the rules file too
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>
9 years agotouchpad: disable trackpoint palm detection on small touchpads
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>
9 years agotouchpad: improve trackpoint palm detection responsiveness
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>
9 years agotouchpad: always set touch->palm.time on touch begin
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>
9 years agotouchpad: move trackpoint timer stuff into the palm struct
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>
9 years agotest: increase the udev init timeout
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>
9 years agoevdev: evdev_fix_abs_resolution can be static
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>
9 years agotest: group the parser tests together
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>
9 years agoAdd missing copyright header to the udev callout
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>
9 years agotouchpad: disable tap drag lock by default
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>
9 years agoAdd missing @ingroup tag to the logging priority enum
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>
9 years agofilter: use a tmp variable for the accel factor
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>
9 years agotools: don't drop the accelerated deltas in ptraccel-debug
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>
9 years agoevdev: move posting a trackpoint scroll event into a helper
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>
9 years agoevdev: log device's DPI setting if any
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>
9 years agoevdev: read dpi before evdev_configure_device
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>
9 years agoevdev: store the device dimensions
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>
9 years agoAdd missing includes for *stat
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>
9 years agoAdd a debug_trace() macro for easier debugging
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>
9 years agotouchpad: fix stuck finger after a click
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>
9 years agotools: add --grab option
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>
9 years agotools: pass a context around as userdata
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>
9 years agotools: move the interface into the shared code
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>
9 years agotools: remove obsolete comments
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>
9 years agoFix an indentation issue
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>
9 years agotouchpad: reduce edge scroll motion threshold to 3mm
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>
9 years agotouchpad: only send most recent edge delta when triggering threshold
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>
9 years agotest: add non-draglock test and rename draglock-dependent tests
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>
9 years agotools: hook up drag lock config
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>
9 years agotouchpad: hook up drag lock configuration
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>
9 years agoAdd configuration interface for tap drag-lock
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>
9 years agotest: replace tap config with helper function
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>
9 years agoudev: prepend the libinput group with the product string
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>
9 years agoExtend CODING_STYLE with the if/else requirements
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>
9 years agotools: drop superfluous linebreaks in ptraccel-debug
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>
9 years agoconfigure.ac: libinput 0.18.0 0.18.0
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>
9 years agotest: drop extra finger up/down in tapndrag + click test
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>
9 years agotools: drop some superfluous parenthesis
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>
9 years agotouchpad: mark ALPS touchpads for middle button emulation
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>
9 years agotest: add ALPS DualPoint device
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>
9 years agotouchpad: disable right-edge palm detection for edge scrolling
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>
9 years agotest: move tapping tests into a separate binary
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>
9 years agotest: switch clickpad multitap to a ranged test
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>
9 years agotest: fix missing range value when the first test case is a ranged one
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>
9 years agotest: replace two asserts with litest_asserts
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>
9 years agoFix documentation for tap_get_enabled()
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>
9 years agoCOPYING: Update boilerplate from MIT X11 to MIT Expat license
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>
9 years agotouchpad: set the finger pin distance to 5mm where possible
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>
9 years agotouchpad: fix pinned finger drifting
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>
9 years agoudev: drop erroneous trailing colon from dmi matches
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>
9 years agotouchpad: make the hysteresis dependent on physical distance
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>
9 years agoMove Wacom touchpad tagging to the udev rules
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>
9 years agoMove apple touchpad tagging to the udev rules
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>
9 years agotest: always install our own udev rule/hwdb files for tests
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>
9 years agotest: add missing libunwind cflags to test-litest-selftest
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>
9 years agofilter: require minimum acceleration factor of 0.3
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>
9 years agotouchpad: restart the motion filter on touch begin
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>
9 years agodoc: make horizontal scrolling a separate section
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>
9 years agodoc: provide an outline of which scroll method is available where
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>
9 years agodoc: add a note that middle-button dragging is not possible on sticks
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>
9 years agotest: fix litest_log() when libunwind is missing
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>
9 years agotest: replace a strncmp call with strneq
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>
9 years agotouchpad: fix whitespace issue
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>
9 years agoconfigure.ac: libinput 0.17.0 0.17.0
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>