platform/upstream/libinput.git
9 years agoTag synaptics serial touchpads with a LIBINPUT_MODEL tag
Peter Hutterer [Thu, 16 Jul 2015 06:05:48 +0000 (16:05 +1000)]
Tag synaptics serial touchpads with a LIBINPUT_MODEL tag

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: allow for multiple LIBINPUT_MODEL_* flags per device
Peter Hutterer [Thu, 16 Jul 2015 05:59:01 +0000 (15:59 +1000)]
evdev: allow for multiple LIBINPUT_MODEL_* flags per device

On some devices we need to set more than one flag, i.e. make it into actual
flags.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotools: handle the initial set of events at event-gui's startup
Peter Hutterer [Tue, 21 Jul 2015 01:53:57 +0000 (11:53 +1000)]
tools: handle the initial set of events at event-gui's startup

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: restore pointing stick const accel property parsing
Peter Hutterer [Mon, 20 Jul 2015 23:33:47 +0000 (09:33 +1000)]
evdev: restore pointing stick const accel property parsing

Regression introduced in 8302860.

Reading the DPI before evdev_configure_device makes it lose on the trackpoint
flag, causing libinput to ignore the POINTINGSTICK_CONST_ACCEL property.

8302860 moved it up so we can init accel based on the DPI, this patch simply
moves istart t before the acceleration is initialized.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMark internal log functions with attribute(printf)
Peter Hutterer [Tue, 21 Jul 2015 01:01:39 +0000 (11:01 +1000)]
Mark internal log functions with attribute(printf)

And fix all the places where we passed in garbage.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: log a trackpoint const accel setting
Peter Hutterer [Mon, 20 Jul 2015 21:31:36 +0000 (07:31 +1000)]
evdev: log a trackpoint const accel setting

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoCode cleanup
Thomas Hindoe Paaboel Andersen [Mon, 20 Jul 2015 01:27:09 +0000 (03:27 +0200)]
Code cleanup

Removes some dead assignments, an unused function, and
uses %d format specifier for int.

Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoDrop vector_length(), replace with hypot(3)
Peter Hutterer [Mon, 20 Jul 2015 01:09:19 +0000 (11:09 +1000)]
Drop vector_length(), replace with hypot(3)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop two now unused defines
Peter Hutterer [Mon, 20 Jul 2015 01:02:47 +0000 (11:02 +1000)]
touchpad: drop two now unused defines

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools: only print angle/scale for pinch events
Peter Hutterer [Mon, 20 Jul 2015 00:59:45 +0000 (10:59 +1000)]
tools: only print angle/scale for pinch events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: fix typo
Peter Hutterer [Fri, 17 Jul 2015 01:02:34 +0000 (11:02 +1000)]
touchpad: fix typo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add 3fg and 4fg clickfinger tests
Peter Hutterer [Fri, 17 Jul 2015 00:55:34 +0000 (10:55 +1000)]
test: add 3fg and 4fg clickfinger tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: remove a leftover check for fake resolution
Peter Hutterer [Thu, 16 Jul 2015 05:54:47 +0000 (15:54 +1000)]
touchpad: remove a leftover check for fake resolution

obsolete since 8658ff159d416b6a567acb2aaf72b27887ad8576. And once we remove
that all we checkf or is Apple models which we set a resolution for in
systemd. So that check is obsolete now too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoudev: don't install the litest udev rules
Peter Hutterer [Thu, 16 Jul 2015 05:15:20 +0000 (15:15 +1000)]
udev: don't install the litest udev rules

They are installed by the test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoconfigure.ac: libinput 0.20.0 0.20.0
Peter Hutterer [Thu, 16 Jul 2015 04:15:11 +0000 (14:15 +1000)]
configure.ac: libinput 0.20.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: fix path to custom litest rules
Peter Hutterer [Thu, 16 Jul 2015 02:24:29 +0000 (12:24 +1000)]
test: fix path to custom litest rules

Fixes distcheck

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: use bootstrap for doxygen styling
Peter Hutterer [Thu, 16 Jul 2015 01:22:36 +0000 (11:22 +1000)]
doc: use bootstrap for doxygen styling

Makes the documentation less of an eyesore.

Header/footer from:
https://github.com/Velron/doxygen-bootstrapped, Apache-licensed

Bootstrap style from:
https://bootswatch.com/paper/, MIT licensed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: strip doxygen file from all default values
Peter Hutterer [Thu, 16 Jul 2015 01:10:22 +0000 (11:10 +1000)]
doc: strip doxygen file from all default values

Only keep those that we changed locally, which makes it much easier to detect
what we're actually changing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: add a page about the available tools
Peter Hutterer [Thu, 16 Jul 2015 00:56:55 +0000 (10:56 +1000)]
doc: add a page about the available tools

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>