platform/upstream/libinput.git
9 years agodoc: group the "related pages" by general topic
Peter Hutterer [Thu, 16 Jul 2015 00:31:34 +0000 (10:31 +1000)]
doc: group the "related pages" by general topic

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop thumb handling from gestures
Peter Hutterer [Wed, 15 Jul 2015 00:04:46 +0000 (10:04 +1000)]
touchpad: drop thumb handling from gestures

Thumb detection interfered with gestures a fair bit but it shouldn't. A pinch
gesture with a thumb is a fairly natural move so we shouldn't cancel that.
A swipe gesture with a thumb on the touchpad - well, don't do that. No need
for code here.

Reported-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
9 years agotest: add a couple of basic gesture tests
Peter Hutterer [Tue, 7 Jul 2015 01:52:05 +0000 (11:52 +1000)]
test: add a couple of basic gesture tests

3finger swipe, pinch and spread. While we expect the pinch/spread to have a
zero angle, the discrete coordinates we use cause some angle, but below 1
degree.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: parse LIBINPUT_ATTR_RESOLUTION_HINT
Peter Hutterer [Fri, 10 Jul 2015 03:59:06 +0000 (13:59 +1000)]
evdev: parse LIBINPUT_ATTR_RESOLUTION_HINT

For Elantech touchpads, we know that the resolution is 31u/mm (800dpi) for
v1-v3 firmware. Set this as a hint until we get either the kernel or systemd
to set this for us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: fix typo in comment
Peter Hutterer [Tue, 14 Jul 2015 21:33:12 +0000 (07:33 +1000)]
touchpad: fix typo in comment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: check for fcntl() return value
Peter Hutterer [Tue, 14 Jul 2015 04:19:25 +0000 (14:19 +1000)]
test: check for fcntl() return value

Mostly to silence coverity complaints.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop fake resolution handling
Peter Hutterer [Tue, 30 Jun 2015 10:56:03 +0000 (20:56 +1000)]
touchpad: drop fake resolution handling

Now that we have all devices init a fixed resolution we don't need code to
handle custom cases anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: default to a 69x50mm sized touchpad
Peter Hutterer [Tue, 30 Jun 2015 04:26:11 +0000 (14:26 +1000)]
touchpad: default to a 69x50mm sized touchpad

The previous approach of using the axis ranges and approximating parameters
based on the x/y axis range clutters up the code and is generally unreliable.
If we look at Synaptics touchpads, the resolution ranges from 42 to 130 while
the axes stay the same axis range. Other touchpads likely have a similar
variation across the various models.

Let's make this simpler in code: unless we know otherwise, simply assume a
default-sized touchpad.
Anything that deviates from that can be fixed with the new hwdb entries to
provide a more correct setting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoudev: add size hint for apple touchpads
Peter Hutterer [Tue, 30 Jun 2015 03:03:56 +0000 (13:03 +1000)]
udev: add size hint for apple touchpads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoudev: add ALPS firmware detection and size properties
Peter Hutterer [Tue, 30 Jun 2015 03:00:10 +0000 (13:00 +1000)]
udev: add ALPS firmware detection and size properties

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoudev: add a model-quirks callout
Peter Hutterer [Thu, 9 Jul 2015 03:47:52 +0000 (13:47 +1000)]
udev: add a model-quirks callout

Some model-specific information isn't available through udev properties. This
callout is used to query the device directly and set a property that we can
then match on for the hwdb entries.

This is geared for Elantech and ALPS touchpads where the firmware version is
the interesting bit. The udev rule is added already to match on that, note
that the callout doesn't do anything at this point. The various
touchpad-related things will be added separately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: use LIBINPUT_ATTR_SIZE_HINT for resolutions
Peter Hutterer [Tue, 30 Jun 2015 02:15:12 +0000 (12:15 +1000)]
evdev: use LIBINPUT_ATTR_SIZE_HINT for resolutions

Touchpads, notably Elantech, ALPS and bcm5974 don't provide x/y resolution
until recent generations.
Add a new property, LIBINPUT_ATTR_SIZE_HINT, that provides size information to
libinput. Note that this property *does not* override true resolution values,
it is only used when the resolution is missing. It is used merely as an
approximate size hint.

If the resolution for a specific device is known it should be added to the
udev hwdb so it can be set globally. See the bcm5974 entries here:
http://cgit.freedesktop.org/systemd/systemd/tree/hwdb/60-evdev.hwdb.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoutil: add a helper function to parse a "WIDTHxHEIGHT" property
Peter Hutterer [Tue, 30 Jun 2015 02:00:53 +0000 (12:00 +1000)]
util: add a helper function to parse a "WIDTHxHEIGHT" property

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: remove some excessive linebreaks
Peter Hutterer [Mon, 13 Jul 2015 05:39:13 +0000 (15:39 +1000)]
test: remove some excessive linebreaks

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop obsolete comment
Peter Hutterer [Mon, 13 Jul 2015 01:06:05 +0000 (11:06 +1000)]
touchpad: drop obsolete comment

Comment is obsolete now that we have edge scrolling on clickpads, see
abff4a1c24830931f1cbd5e54d5b1a4621eab863

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: add gesture state debug helper
Peter Hutterer [Fri, 10 Jul 2015 05:03:42 +0000 (15:03 +1000)]
touchpad: add gesture state debug helper

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add an Elantech touchpad device
Peter Hutterer [Fri, 10 Jul 2015 04:11:11 +0000 (14:11 +1000)]
test: add an Elantech touchpad device

This is an old recording and predates properties. It's not a clickpad, we
assume INPUT_PROP_POINTER is set.
From: https://bugs.freedesktop.org/attachment.cgi?id=57154

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: prefix all test device files with litest-device
Peter Hutterer [Fri, 10 Jul 2015 04:06:11 +0000 (14:06 +1000)]
test: prefix all test device files with litest-device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add an Apple Magic Trackpad test device
Peter Hutterer [Fri, 10 Jul 2015 02:01:15 +0000 (12:01 +1000)]
test: add an Apple Magic Trackpad test device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: move finger position to test for right button down
Peter Hutterer [Fri, 10 Jul 2015 02:41:59 +0000 (12:41 +1000)]
test: move finger position to test for right button down

On large touchpads with resolution, 90% of the touchpad may be north of the
button.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: reduce movement of finger while pinned
Peter Hutterer [Fri, 10 Jul 2015 02:39:35 +0000 (12:39 +1000)]
test: reduce movement of finger while pinned

Otherwise the test fails on large touchpads with resolution (magic trackpad).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: replace hardcoded wacom ID with the #define
Peter Hutterer [Fri, 10 Jul 2015 03:08:38 +0000 (13:08 +1000)]
test: replace hardcoded wacom ID with the #define

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: slow down 2fg slow scroll movement
Peter Hutterer [Fri, 10 Jul 2015 01:26:18 +0000 (11:26 +1000)]
test: slow down 2fg slow scroll movement

To avoid test case failures when we switch to forced resolutions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: fix memleak in the udev_device_sysname() test
Peter Hutterer [Thu, 9 Jul 2015 06:46:00 +0000 (16:46 +1000)]
test: fix memleak in the udev_device_sysname() test

If a device sends other events at startup, those events weren't freed. This
can happen on tablet devices that send proximity events immediately after
DEVICE_ADDED.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: simplify setting a fake resolution
Peter Hutterer [Tue, 30 Jun 2015 02:07:16 +0000 (12:07 +1000)]
evdev: simplify setting a fake resolution

The only two callers passed in the fake resolution anyway, so we don't need
extra parameters here.
We don't allow devices with only x or y resolution set, either both or none.
And we can use libevdev_set_abs_resolution() rather than handling absinfo
structs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoudev: make sure the udev callout path is valid for a test run
Peter Hutterer [Wed, 1 Jul 2015 00:17:48 +0000 (10:17 +1000)]
udev: make sure the udev callout path is valid for a test run

udev requires callout binaries to sit in /lib/udev or otherwise provide an
absolute path. The test suite should work without installing everything first,
so create two rule files - one to install, one with the path to the
$builddir/test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add touchpad thumb detection tests
Peter Hutterer [Mon, 6 Jul 2015 06:41:41 +0000 (16:41 +1000)]
test: add touchpad thumb detection tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: work thumb detection into the tap state machine
Peter Hutterer [Mon, 6 Jul 2015 05:22:45 +0000 (15:22 +1000)]
touchpad: work thumb detection into the tap state machine

Most thumbs are detected a few events into the sequence. Work this into parts
of the tapping state machine. Only the most common use-case is handled here -
if the first finger ends up being marked as a thumb, we return to the idle
state and ignore that touch sequence.

At any other state, we handle thumbs like any other finger.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: add pressure-based thumb-detection
Peter Hutterer [Wed, 27 May 2015 08:25:49 +0000 (18:25 +1000)]
touchpad: add pressure-based thumb-detection

All touchpad recordings seen so far show that a value above 100 is definitely
a thumb or a palm. Values below are harder to discern, and the same isn't true
for touchpads supporting ABS_PRESSURE instead of ABS_MT_PRESSURE.

The handling of a touch is as outlined in tp_thumb_detect:
* thumbs are ignored for pointer motion
* thumbs cancel gestures
* thumbs are ignored for clickfinger count
* edge scrolling doesn't care either way
* software buttons don't care either way
* tap: only if thumb on begin

The handling of thumbs while tapping is the simplest approach only, more to
come in follow-up patches.

Note that "thumb" is the synonym for "this touch is too big to be a
fingertip". Which means that a light thumb touch will still be counted as a
finger. The side-effect here is that thumbs resting a the bottom edge of the
touchpad will almost certainly not trigger the pressure threshold because
most of the thumb is off the touchpad.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: allow for a default value on LITEST_AUTO_ASSIGNS
Peter Hutterer [Mon, 6 Jul 2015 06:26:21 +0000 (16:26 +1000)]
test: allow for a default value on LITEST_AUTO_ASSIGNS

The touchpads currently all send a default value of 30 for ABS_PRESSURE. For
some tests we want to have a custom pressure but changing all tests isn't
sensible. So hook each device up to send a default value of 30 if it isn't
overridden in the test itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: be smarter about clickfinger thumb detection
Peter Hutterer [Fri, 3 Jul 2015 00:30:06 +0000 (10:30 +1000)]
touchpad: be smarter about clickfinger thumb detection

Watching a colleague try clickfinger right-click after enabling it the first
time showed that the vertical distance is too small. Increase it to 30mm
instead.

Increase the allowed spread between fingers to 40x30mm, but check if one of
the fingers is in the bottom-most 20mm of the touchpad. If that's the case,
and the touchpad is large enough to be feasable for resting a thumb on it,
discard the finger for clickfinger count.

If both fingers are in that area or one finger is in the area and they're
really close together, the fingers count separately and are not regarded as
thumb.

https://bugs.freedesktop.org/show_bug.cgi?id=91046

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: allow edge scrolling on clickpads
Peter Hutterer [Fri, 3 Jul 2015 04:33:41 +0000 (14:33 +1000)]
touchpad: allow edge scrolling on clickpads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: add helper function for enabling click methods
Peter Hutterer [Fri, 3 Jul 2015 05:23:41 +0000 (15:23 +1000)]
test: add helper function for enabling click methods

Makes the test code easier to read. In tests where we explicitly check the API
the real calls were left in place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: move enable_edge_scroll up
Peter Hutterer [Fri, 3 Jul 2015 05:17:33 +0000 (15:17 +1000)]
test: move enable_edge_scroll up

No functional changes, just so we can group those helpers together.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: fix a misaligned {
Peter Hutterer [Wed, 8 Jul 2015 23:32:40 +0000 (09:32 +1000)]
touchpad: fix a misaligned {

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoAdd more rules to CODING_STYLE
Peter Hutterer [Tue, 7 Jul 2015 22:38:11 +0000 (08:38 +1000)]
Add more rules to CODING_STYLE

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agolitest: floating point comparison macros
Andreas Pokorny [Mon, 22 Jun 2015 10:48:07 +0000 (12:48 +0200)]
litest: floating point comparison macros

Adds the macros ck_assert_double_{eq,ne,lt,gt,le,ge} to compare double
values using a fixed tolerance value. The tolerance value is
picked based on the range of values to be expected by the libinput API.

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 nexus4 style touch screen without orientation
Andreas Pokorny [Mon, 6 Jul 2015 15:05:03 +0000 (17:05 +0200)]
litest: add nexus4 style touch screen without orientation

This device provides a circular touch point size and and hence lacks
orientation. It will be used to test default value handling.

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 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>