platform/upstream/libinput.git
9 years agoMerge branch 'edge-scroll-on-edge-only'
Peter Hutterer [Thu, 23 Jul 2015 04:50:03 +0000 (14:50 +1000)]
Merge branch 'edge-scroll-on-edge-only'

9 years agoMerge branch 'serial-synaptics-cursor-jump'
Peter Hutterer [Thu, 23 Jul 2015 00:34:03 +0000 (10:34 +1000)]
Merge branch 'serial-synaptics-cursor-jump'

9 years agoMerge branch 'reduce-motion-thresholds'
Peter Hutterer [Thu, 23 Jul 2015 00:28:49 +0000 (10:28 +1000)]
Merge branch 'reduce-motion-thresholds'

9 years agotouchpad: only edge-scroll while the finger is in the edge area
Peter Hutterer [Mon, 13 Jul 2015 04:14:42 +0000 (14:14 +1000)]
touchpad: only edge-scroll while the finger is in the edge area

When the touch leaves the area for edge scrolling after starting to scroll,
discard any movement. This signals to the user that they've left the area and
forces them to lift the finger to switch back to motion. If the finger moves
back into the area, scrolling continues.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: make the edge-scroll edge 7mm wide
Peter Hutterer [Mon, 13 Jul 2015 02:56:39 +0000 (12:56 +1000)]
touchpad: make the edge-scroll edge 7mm wide

Rather than magic percentages of the touchpad axis ranges, make it a fixed
size of 7mm.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: enable 2fg scrolling on most palm tests
Peter Hutterer [Tue, 14 Jul 2015 01:30:50 +0000 (11:30 +1000)]
test: enable 2fg scrolling on most palm tests

edge scrolling disables some palm detection, so we can't run those tests when
active. That fell through the cracks so far, all devices with edge scroll by
default were too small to enable palm detection.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: fix hover test to avoid the edge scroll zone
Peter Hutterer [Tue, 14 Jul 2015 02:06:03 +0000 (12:06 +1000)]
test: fix hover test to avoid the edge scroll zone

On the synaptics hover device where this test is run, we'd eventually get into
the edge scroll zone. When edge scrolling is enabled this causes the test to
fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: reset the motion history during/after a slots->nfake crossover
Peter Hutterer [Mon, 20 Jul 2015 03:10:29 +0000 (13:10 +1000)]
touchpad: reset the motion history during/after a slots->nfake crossover

Whenever we cross from N slots to at least one fake finger, reset the motion
history and skip the next event too. Especially on serial Synaptics touchpads,
the first touch update after a two-slot → TRIPLETAP is garbage, as is the one
from TRIPLETAP → two slots.

Example sequence reproduce on a T440s:

E: 4.488757 0003 003a 0084      # EV_ABS / ABS_MT_PRESSURE      84
E: 4.488757 0003 002f 0001      # EV_ABS / ABS_MT_SLOT          1
E: 4.488757 0003 0039 0433      # EV_ABS / ABS_MT_TRACKING_ID   433
E: 4.488757 0003 0035 2500      # EV_ABS / ABS_MT_POSITION_X    2500
E: 4.488757 0003 0036 3064      # EV_ABS / ABS_MT_POSITION_Y    3064
E: 4.488757 0003 003a 0060      # EV_ABS / ABS_MT_PRESSURE      60
E: 4.488757 0003 0018 0084      # EV_ABS / ABS_PRESSURE         84
E: 4.488757 0001 0145 0000      # EV_KEY / BTN_TOOL_FINGER      0
E: 4.488757 0001 014e 0001      # EV_KEY / BTN_TOOL_TRIPLETAP   1
E: 4.488757 0000 0000 0000      # ------------ SYN_REPORT (0) ----------
E: 4.508506 0003 002f 0000      # EV_ABS / ABS_MT_SLOT          0
E: 4.508506 0003 0036 2982      # EV_ABS / ABS_MT_POSITION_Y    2982
E: 4.508506 0003 003a 0086      # EV_ABS / ABS_MT_PRESSURE      86
E: 4.508506 0003 002f 0001      # EV_ABS / ABS_MT_SLOT          1
E: 4.508506 0003 0035 3464      # EV_ABS / ABS_MT_POSITION_X    3464
E: 4.508506 0003 0036 2716      # EV_ABS / ABS_MT_POSITION_Y    2716
E: 4.508506 0003 0001 2982      # EV_ABS / ABS_Y                2982
E: 4.508506 0003 0018 0086      # EV_ABS / ABS_PRESSURE         86
E: 4.508506 0000 0000 0000      # ------------ SYN_REPORT (0) ----------

subsequent events then hover around the 3464 mark, but that initial jump is
enough to cause a massive cursor jump.

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

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 agotouchpad: handle serial synaptics slot confusion on TRIPLETAP
Peter Hutterer [Thu, 16 Jul 2015 23:30:03 +0000 (09:30 +1000)]
touchpad: handle serial synaptics slot confusion on TRIPLETAP

Synatics touchpads only have 2 slots, but support TRIPLETAP and above. When
the third finger touches, the kernel may end the second slot and re-start it
with the coordinates of the third touch in the next frame. The event sequence
is something like:

ABS_MT_SLOT          0
ABS_MT_POSITION_X    4000
ABS_MT_POSITION_Y    4000
ABS_MT_PRESSURE      78
ABS_MT_SLOT          1
ABS_MT_TRACKING_ID   -1

ABS_X                4000
ABS_Y                4000
ABS_PRESSURE         78
BTN_TOOL_DOUBLETAP   0
BTN_TOOL_TRIPLETAP   1
--- SYN_REPORT (0) ----------
ABS_MT_SLOT          0
ABS_MT_POSITION_X    4000
ABS_MT_POSITION_Y    4000
ABS_MT_PRESSURE      78
ABS_MT_SLOT          1
ABS_MT_TRACKING_ID   55
ABS_MT_POSITION_X    2000
ABS_MT_POSITION_Y    2000
ABS_MT_PRESSURE      72

ABS_X                4000
ABS_Y                4000
ABS_PRESSURE         78
--- SYN_REPORT (0) ----------

libinput usually ignores any BTN_TOOL_* <= num_slots since we expect
that the slot values are valid. Make an exception for the serial synaptics
touchpads. If a touch has ended when the fake touch goes above active-slots
(but still within num-slots), move that touch back to UPDATE. This ensures the
right number of nfingers_down. When the touch restarts again in the next
frame, tp_begin_touch() will skip over re-initializing it because it's already
in UPDATE anyway.

Note that at this point this only handles the transition _to_ TRIPLETAP, not
from TRIPLETAP to DOUBLETAP. Need to wait for this to be seen in the wild
first.

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

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 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 agotest: only run 3-slot test for touchpads with three slots
Peter Hutterer [Tue, 21 Jul 2015 23:21:13 +0000 (09:21 +1000)]
test: only run 3-slot test for touchpads with three slots

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMove CASE_RETURN_STRING to libinput-util.h
Peter Hutterer [Mon, 20 Jul 2015 04:37:37 +0000 (14:37 +1000)]
Move CASE_RETURN_STRING to libinput-util.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: reduce unpin threshold to 1.5mm
Peter Hutterer [Mon, 20 Jul 2015 01:24:17 +0000 (11:24 +1000)]
touchpad: reduce unpin threshold to 1.5mm

3mm is too large, it makes the touchpad feel sluggish. We already take fuzz
into account through the hysteresis and the real issue we have with the
pointer moving on a click is _before_ the BTN_LEFT event comes in, not after.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: reduce 2fg scroll threshold to 2mm
Peter Hutterer [Mon, 20 Jul 2015 01:13:55 +0000 (11:13 +1000)]
touchpad: reduce 2fg scroll threshold to 2mm

3mm is too large, especially on fine-grained scroll motions. Since we
already use the hysteresis to defuzz the current touchpad point, having a
slower threshold here should not cause any adverse motions.

This affects the pinch gestures too and needs a minor test adjustment. The
atmel hover device's resolution is low enough that we trigger a >1 degree
angle now, make the movement a bit more finegrained.

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

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