platform/upstream/libinput.git
7 years agotools: add a tool to measure touch size and orientation
Peter Hutterer [Wed, 5 Jul 2017 08:50:52 +0000 (18:50 +1000)]
tools: add a tool to measure touch size and orientation

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: add touch-size-based palm detection
Peter Hutterer [Thu, 23 Mar 2017 04:54:00 +0000 (14:54 +1000)]
touchpad: add touch-size-based palm detection

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: add touch-size based touch handling
Peter Hutterer [Wed, 22 Mar 2017 06:16:21 +0000 (16:16 +1000)]
touchpad: add touch-size based touch handling

Apple touchpads don't use ABS_MT_PRESSURE but they are multitouch touchpads,
so the current pressure-based handling code doesn't apply because it expects
slot-based pressure for mt touchpads.

Apple does however send useful data for ABS_MT_WIDTH_MAJOR/MINOR, so let's use
that instead. The data provided in those is more-or-less random, so we need a
hwdb entry to track the acceptable thresholds.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoutil: rename the pressure range parser to a more generic range_parser
Peter Hutterer [Wed, 5 Jul 2017 06:25:40 +0000 (16:25 +1000)]
util: rename the pressure range parser to a more generic range_parser

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: loosen up litest to allow major/minor handling
Peter Hutterer [Wed, 29 Mar 2017 02:31:12 +0000 (12:31 +1000)]
test: loosen up litest to allow major/minor handling

The max values on ABS_MT_TOUCH_MAJOR/MINOR aren't hard limits, they basically
represent the size of a finger with (afaict) a suggestion that anything
greater than the max may be a palm. Disable the 0-100% range checks for those
axes so we can send custom events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: force-release major/minor on the default touch up
Peter Hutterer [Tue, 28 Mar 2017 01:22:27 +0000 (11:22 +1000)]
test: force-release major/minor on the default touch up

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: set keyboard to non-active when the keyboard is removed
Peter Hutterer [Tue, 11 Jul 2017 01:41:15 +0000 (11:41 +1000)]
touchpad: set keyboard to non-active when the keyboard is removed

If the keyboard is removed while dwt thinks it is in active state, that state
is never reset and subsequent touches are ignored.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotimer: add a timer name to each timer
Peter Hutterer [Mon, 3 Jul 2017 01:28:18 +0000 (11:28 +1000)]
timer: add a timer name to each timer

So we have something useful to print when we trigger an error in the timer
code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoutil: drop an unnecessary declaration
Peter Hutterer [Mon, 3 Jul 2017 02:45:12 +0000 (12:45 +1000)]
util: drop an unnecessary declaration

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoAdd support for CircleCI
Peter Hutterer [Wed, 5 Jul 2017 02:34:40 +0000 (12:34 +1000)]
Add support for CircleCI

This isn't currently hooked up to the fdo repo but it's hooked up to my
github mirror. I had SemaphoreCI hooked up to that before but it only
supports ubuntu 14.04 and the recent meson switch made it a bit hard to setup.

CircleCI supports running docker containers, so let's do that and run against
the most recent released Fedora and a recent Ubuntu. I'm not bothering with
rawhide, it's likely to increase the work for little gain when it's in a
semi-broken state.

Run the default build with a few permutations to test meson options. Run
scan-build too but that's just for the logs, eventually this may turn into a
hard failure.

Ubuntu 17.04's meson is too old, so we have to clone that from git. Install
arguments are taken from the meson.deb package.

Most of this effort was done by Benjamin Tissoires.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Benjamin Tissoires <benjamin.tissoires@gmail.com>
7 years agoFix a few things scan-build complains about
Peter Hutterer [Thu, 6 Jul 2017 06:45:41 +0000 (16:45 +1000)]
Fix a few things scan-build complains about

Uninitialized variables, potential NULL dereferences, dead assignments and an
unused return value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: fix flake8 Python style warnings
Peter Hutterer [Mon, 10 Jul 2017 00:07:03 +0000 (10:07 +1000)]
tools: fix flake8 Python style warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: change python sources to use space indentation
Peter Hutterer [Sun, 9 Jul 2017 23:54:34 +0000 (09:54 +1000)]
tools: change python sources to use space indentation

Let's switch to PEP8-compatible format to have a consistent style that matches
other python sources. This will be checked by flake8 which shows a few other
warnings, this patch only changes tabs to 4 spaces.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoudev: fix flake8 style warnings
Peter Hutterer [Sun, 9 Jul 2017 23:38:04 +0000 (09:38 +1000)]
udev: fix flake8 style warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoudev: cleanup hwdb parsing
Peter Hutterer [Fri, 7 Jul 2017 05:52:13 +0000 (15:52 +1000)]
udev: cleanup hwdb parsing

Group into similar props, we really only have value-based properties or
type-based properties. Compress those together so it's easier to understand.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: remove unnecessary full stop in man page
Peter Hutterer [Fri, 7 Jul 2017 03:39:01 +0000 (13:39 +1000)]
tools: remove unnecessary full stop in man page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: add upper edge into exclusion zone
Ming-Yang Lu [Sun, 2 Jul 2017 10:07:20 +0000 (18:07 +0800)]
touchpad: add upper edge into exclusion zone

This reduces unexpected cursor moves when placing the thumb near the border
of trackpoint buttons and upper edge of touchpad.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: sync the slot state after tp_resume()
Peter Hutterer [Thu, 6 Jul 2017 01:46:12 +0000 (11:46 +1000)]
touchpad: sync the slot state after tp_resume()

If the touchpad is suspended and resumed (e.g. lid switch), the initial slot
state may be out of sync. If a touch happened while the touchpad was suspended
and the next touch down is on exactly the same x and/or y coordinate, our
touch point would still have the coordinates of the most recently seen touch
(i.e. before touchpad suspend). This could cause a pointer jump or test case
failures.

The real-world impact of this is minimal, putting the finger down in exactly
the same spot is virtually impossible. It could cause a test case failure in the
lid_disable_touchpad() test though, the second touch sequence was on the same
y coordinate and the touch location for that whole sequence was x/0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: skip double-initialization of all_tests lists
Peter Hutterer [Thu, 6 Jul 2017 23:34:16 +0000 (09:34 +1000)]
test: skip double-initialization of all_tests lists

Already done in main(), this here is a leftover from having multiple mains fro
different tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: fix some tap palm detection tests
Peter Hutterer [Wed, 5 Jul 2017 03:51:29 +0000 (13:51 +1000)]
test: fix some tap palm detection tests

Without the timeout we're not guaranteed that the tap button event triggers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: add missing check for an empty queue to the palm detection test
Peter Hutterer [Wed, 5 Jul 2017 01:48:11 +0000 (11:48 +1000)]
test: add missing check for an empty queue to the palm detection test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: stop changing argv[0] for forked tests
Peter Hutterer [Wed, 5 Jul 2017 05:45:19 +0000 (15:45 +1000)]
test: stop changing argv[0] for forked tests

This was useful when we had a small number of test-forks with the suites
distributed. It helped debug which one is still running and then which suites
are in it. Now that we simply distributed everything across the forks it
doesn't have a lot of usefulness and it interferes with the ability to
backtrace properly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: remove failing thumb edge scroll test
Peter Hutterer [Wed, 5 Jul 2017 06:00:57 +0000 (16:00 +1000)]
test: remove failing thumb edge scroll test

Broken since the merge of palm pressure detection in
25d54b90d, not sure why the test suite succeeded on that one nonetheless.

I'm not 100% sure why the test does what it does but it seems to be testing
that a wide touch on the side still striggers edge scrolling and not the thumb
detection on the bottom of the touchpad. That is obsolete now, it's hard to
generically figure out the small gap between thumb and palm pressure, so this
test almost always triggers palm detection. It's obsolete.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: update the soname, remove the warning
Peter Hutterer [Tue, 4 Jul 2017 23:49:51 +0000 (09:49 +1000)]
doc: update the soname, remove the warning

The soname will remain fixed now, we're going through all the trouble of
having a proper map file so that we don't have to bump it all the time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: fix a few typos
Peter Hutterer [Tue, 4 Jul 2017 23:47:37 +0000 (09:47 +1000)]
doc: fix a few typos

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: move the autotools instructions into their own section
Peter Hutterer [Tue, 4 Jul 2017 23:46:58 +0000 (09:46 +1000)]
doc: move the autotools instructions into their own section

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: expand on the meson build instructions
Peter Hutterer [Tue, 4 Jul 2017 23:39:29 +0000 (09:39 +1000)]
doc: expand on the meson build instructions

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomeson: fix build with --libwacom=false
Peter Hutterer [Tue, 4 Jul 2017 23:30:59 +0000 (09:30 +1000)]
meson: fix build with --libwacom=false

Triggered an error because we still used dep_libwacom unconditionally:
Meson encountered an error in file meson.build, line 76, column 0:
Unknown variable "dep_libwacom".

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoMerge branch 'wip/touchpad-palm-pressure'
Peter Hutterer [Tue, 4 Jul 2017 03:57:32 +0000 (13:57 +1000)]
Merge branch 'wip/touchpad-palm-pressure'

7 years agoDrop autotools
Peter Hutterer [Tue, 4 Jul 2017 03:02:46 +0000 (13:02 +1000)]
Drop autotools

This also makes the gitignore files shorter and/or obsolete.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: send a left button event when we move out of topbuttons and click
Peter Hutterer [Tue, 27 Jun 2017 01:30:51 +0000 (11:30 +1000)]
touchpad: send a left button event when we move out of topbuttons and click

We used to completely ignore a finger that was within the top software button
area and then moved to the main area and remained there for a timeout. This
avoids erroneous pointer movements when the user moves the finger while using
the trackpoint.

But we also ignored physical clicks, something we should not be doing. This
patch fixes that behavior: we still ignore the finger for movement, but a
physical click now triggers a left click once we've been in the area for the
timeout.

This new behavior doesn't apply within the timeout, i.e. if a finger is in the
right top button area, moves out and immediately clicks, we still trigger a
right click. This avoids erroneous switches to left-clicks when the finger is
at the edge of the button area and moves out during the press.

Related to: https://bugs.freedesktop.org/show_bug.cgi?id=99212

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoudev: add custom pressure range for Dell Latitude E6620
Peter Hutterer [Tue, 4 Jul 2017 02:39:09 +0000 (12:39 +1000)]
udev: add custom pressure range for Dell Latitude E6620

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: add a tool to measure touch pressure
Peter Hutterer [Tue, 27 Jun 2017 04:16:57 +0000 (14:16 +1000)]
tools: add a tool to measure touch pressure

And update the documentation for how to use the new tool. It's much more
interactive than evemu and easier to grasp, so let's advertise that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: add pressure-base palm detection
Peter Hutterer [Wed, 28 Jun 2017 03:09:22 +0000 (13:09 +1000)]
touchpad: add pressure-base palm detection

If a touch goes past the fixed pressure threshold it is labelled as a palm and
stays a palm. Default value is one that works well here on a T440 and is
virtually impossible to trigger by a normal finger or thumb. A udev property
is exposed so we can handle this in the udev hwdb and the new tool introduce a
few commits ago can help finding the palm detection threshold.

Unlike the other palm detection features, once a palm goes past the threshold
it remains a palm until the touch is released. This means palm overrides any
other palm detection features. For code simplicity, we don't combine the
states but merely check for pressure before and after the other palm detection
functions. If the pressure triggers, it will trigger before anything else. And
if something else is already active (e.g. edge where the pressure doesn't work
well) it will trigger as soon as the palm is released.

The palm threshold should thus be chosen with some room to spare between the
highest finger pressure.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: increase palm edge zones to 8%
Peter Hutterer [Mon, 26 Jun 2017 22:59:51 +0000 (08:59 +1000)]
touchpad: increase palm edge zones to 8%

Most modern touchpads are around 100mm wide, so this provides a ca 8mm edge
zone on each side. The extra 3mm should provide for more reliable palm
detection, a few touches happen to be just on the edge of the 5mm mark.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoconfigure.ac: libinput 1.8.0 upstream_bkup_20200225 1.8.0
Peter Hutterer [Mon, 3 Jul 2017 05:07:20 +0000 (15:07 +1000)]
configure.ac: libinput 1.8.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: tidy up the libinput man pages again
Peter Hutterer [Mon, 3 Jul 2017 03:33:20 +0000 (13:33 +1000)]
tools: tidy up the libinput man pages again

Make the libinput page more generic but suitable for short attention spans and
most importantly, point to the xf86-input-libinput man page in a more obvious
manner since we're now shadowing that.

The rest of the man pages have punctuation and formatting cleanups only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoREADME: tidy up the documentation links
Peter Hutterer [Mon, 3 Jul 2017 03:43:21 +0000 (13:43 +1000)]
README: tidy up the documentation links

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: add the libinput version to the man pages
Peter Hutterer [Wed, 28 Jun 2017 22:40:28 +0000 (08:40 +1000)]
tools: add the libinput version to the man pages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agomeson: install the libinput-debug-gui if we build it
Peter Hutterer [Tue, 27 Jun 2017 06:59:01 +0000 (16:59 +1000)]
meson: install the libinput-debug-gui if we build it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoREADME: fix link to libinput-debug-events
Peter Hutterer [Tue, 27 Jun 2017 01:15:59 +0000 (11:15 +1000)]
README: fix link to libinput-debug-events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoconfigure.ac: libinput 1.7.902 1.7.902
Peter Hutterer [Mon, 26 Jun 2017 09:04:08 +0000 (19:04 +1000)]
configure.ac: libinput 1.7.902

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: fix invocation of subtools
Peter Hutterer [Mon, 26 Jun 2017 04:05:56 +0000 (14:05 +1000)]
tools: fix invocation of subtools

One dash too many. Oops.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomeson: add preceding spaces before colons where needed
Peter Hutterer [Mon, 26 Jun 2017 03:51:44 +0000 (13:51 +1000)]
meson: add preceding spaces before colons where needed

Meson does not have a single style but the "foo : bar" style is more common in
the docs and in our meson.build file. Make it consistent.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: strdup the suite and test name
Peter Hutterer [Thu, 22 Jun 2017 04:04:47 +0000 (14:04 +1000)]
test: strdup the suite and test name

The check framework takes and stores the pointer and expects it to be live for
the livetime of the test but it doesn't strdup it. We have to keep those
pointers around ourselves.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: split the configuration option parsing out
Peter Hutterer [Mon, 19 Jun 2017 08:38:33 +0000 (18:38 +1000)]
tools: split the configuration option parsing out

We had one shared parsing function for all config options so tools parse
options that don't actually make sense (e.g. --quiet or --show-keycodes for
libinput-list-devices).

This patch splits the actual libinput device configuration out and reshuffles
everything to make use of that. One large patch, because splitting this up is
more confusing than dumping it all.

This means the actual option parsing is partially duplicated between debug-gui
and debug-events but hey, not everything in life is perfect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: ignore the tap motion threshold if fingers > slots
Peter Hutterer [Thu, 15 Jun 2017 04:13:26 +0000 (14:13 +1000)]
touchpad: ignore the tap motion threshold if fingers > slots

Do so on the synaptics serial touchpads at least, they're known to cause
cursor jumps when the third finger is down. Not detecting a tap move means
three-finger taps get more reliable on these touchpads.

This change affects gestures who now effectively have to wait for the tap
timeout to happen. It's a trade-off.

https://bugs.freedesktop.org/show_bug.cgi?id=101435
https://bugzilla.redhat.com/show_bug.cgi?id=1455443

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomeson: swap libinput dependencies
Peter Hutterer [Fri, 23 Jun 2017 05:13:20 +0000 (15:13 +1000)]
meson: swap libinput dependencies

Since meson commit ae9b238 "ninja: De-dup libraries and use --start/end-group"
we get linker errors with the tools. The duplication is apparently a bit too
agressive, swapping the order here make sure libinput isn't removed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reported-by: Michel Dänzer <michel@daenzer.net>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoSkip restorecon if it cannot be found
Peter Hutterer [Thu, 22 Jun 2017 23:35:27 +0000 (09:35 +1000)]
Skip restorecon if it cannot be found

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: shorten the --help output for the commands
Peter Hutterer [Mon, 19 Jun 2017 07:13:38 +0000 (17:13 +1000)]
tools: shorten the --help output for the commands

The full information is now in the man page, the usage() now just tells you
how to use it. This way there's only one place to maintain it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: remove duplicate test
Peter Hutterer [Thu, 22 Jun 2017 02:57:21 +0000 (12:57 +1000)]
test: remove duplicate test

Copy/paste error, no functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: update the timestamp even when we only get other axes
Peter Hutterer [Wed, 21 Jun 2017 01:39:08 +0000 (11:39 +1000)]
touchpad: update the timestamp even when we only get other axes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: rename tp_touch->millis to tp_touch->time
Peter Hutterer [Wed, 21 Jun 2017 01:02:48 +0000 (11:02 +1000)]
touchpad: rename tp_touch->millis to tp_touch->time

This is in Âµs and hasn't been in ms for a long time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomeson: restore the SELinux context for our .so file on install
Peter Hutterer [Tue, 20 Jun 2017 23:16:06 +0000 (09:16 +1000)]
meson: restore the SELinux context for our .so file on install

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
7 years agodoc: update build instructions for Arch
Eric Engestrom [Tue, 20 Jun 2017 13:06:08 +0000 (14:06 +0100)]
doc: update build instructions for Arch

`abs` has been deprecated, and shut down last month. [1]
`asp` replaces it, so rewrite the instructions to use this instead.

Also, add `--noextract` to the makepkg command, as there is no point
downloading and extracting the sources since they're not going to be
built here.

[1] https://www.archlinux.org/news/deprecation-of-abs/

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: add instructions for handling SELinux denials
Peter Hutterer [Mon, 12 Jun 2017 05:12:06 +0000 (15:12 +1000)]
doc: add instructions for handling SELinux denials

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agotools: add the compat scripts installer script to the tarball
Peter Hutterer [Tue, 20 Jun 2017 01:18:10 +0000 (11:18 +1000)]
tools: add the compat scripts installer script to the tarball

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agomeson: build docs by default, but allow disabling it
Peter Hutterer [Tue, 20 Jun 2017 01:17:39 +0000 (11:17 +1000)]
meson: build docs by default, but allow disabling it

This is the behavior of configure as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agomeson: rename 'enable-tests' option to just 'tests'
Peter Hutterer [Tue, 20 Jun 2017 01:14:25 +0000 (11:14 +1000)]
meson: rename 'enable-tests' option to just 'tests'

All the other config options have a simple true/false as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agodoc: Fix mistake in Matrix example to relect only X along Y axis
Philippe Coval [Fri, 16 Jun 2017 23:13:28 +0000 (01:13 +0200)]
doc: Fix mistake in Matrix example to relect only X along Y axis

On some devices, X coordinate is not working well, like if it is swapped:
click on right, pointer appear on left and vice versa.

To sort this issue, coordinates should be reflected on Y axis:
- new X position is changed (width is subtracted by X position)
- Y is unchanged (it was wrongly set to X)

In landscape (or portrait) mode:

                [  x  ]
                [  y  ]
                [  1  ]
              *    =
  [ -1 0 1  ]   [  x' ] = -x + 0*y + 1*width
  [  0 1 0  ]   [  y' ] = 0*x + 1*y + 0*height
  [  0 0 1  ]   [  1  ]

This was verified using this touch screen (usb="0eef:0001")

  E: ID_VENDOR=eGalax_Inc.
  E: ID_VENDOR_ENC=eGalax\x20Inc.
  E: ID_VENDOR_ID=0eef

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

Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: use the "is internal keyboard" tag to enable dwt
Peter Hutterer [Fri, 2 Jun 2017 03:32:46 +0000 (13:32 +1000)]
touchpad: use the "is internal keyboard" tag to enable dwt

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: drop the Fedora "ninja-build" note
Peter Hutterer [Mon, 19 Jun 2017 03:11:58 +0000 (13:11 +1000)]
doc: drop the Fedora "ninja-build" note

The packages have been in stable for 6 weeks as of this patch, let's not worry
about the old ones.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: assert on malloc failure
Peter Hutterer [Mon, 19 Jun 2017 02:15:54 +0000 (12:15 +1000)]
tools: assert on malloc failure

No need for proper recovery here in this debugging tool.
Also sneak in a whitespace fix while we're here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoevdev: default to log error priority
Peter Hutterer [Mon, 19 Jun 2017 00:37:36 +0000 (10:37 +1000)]
evdev: default to log error priority

Fixes compiler warning:
evdev.c:2899:2: warning: 'pri' may be used uninitialized in this function
[-Wmaybe-uninitialized]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoconfigure.ac: libinput 1.7.901 1.7.901
Peter Hutterer [Thu, 15 Jun 2017 08:01:13 +0000 (18:01 +1000)]
configure.ac: libinput 1.7.901

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: grab the pointer in the debug gui
Peter Hutterer [Tue, 13 Jun 2017 05:18:56 +0000 (15:18 +1000)]
tools: grab the pointer in the debug gui

Because it's too annoying to trigger the hot corner every few seconds while
pointer debugging.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agogitignore: drop test/test-* pattern
Peter Hutterer [Wed, 14 Jun 2017 05:35:28 +0000 (15:35 +1000)]
gitignore: drop test/test-* pattern

Obsolete since the libinput-test-suite-runner was added

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoRemove vestiges of the event-gui
Peter Hutterer [Wed, 14 Jun 2017 02:57:19 +0000 (12:57 +1000)]
Remove vestiges of the event-gui

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: note that the touchpad-tap measuring tool picks a touchpad
Peter Hutterer [Tue, 13 Jun 2017 03:53:10 +0000 (13:53 +1000)]
tools: note that the touchpad-tap measuring tool picks a touchpad

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: use the same formatting for the gcc command as for everything else
Peter Hutterer [Tue, 13 Jun 2017 02:32:43 +0000 (12:32 +1000)]
doc: use the same formatting for the gcc command as for everything else

Without the @code tag, the font size differs to everything else in this file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: update building notes with the bug to ninja vs ninja-build on Fedora
Peter Hutterer [Tue, 13 Jun 2017 02:30:35 +0000 (12:30 +1000)]
doc: update building notes with the bug to ninja vs ninja-build on Fedora

Up-to-date Fedora doesn't need to use ninja-build anymore

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: update the publish-doc tool to use ninja
Peter Hutterer [Tue, 13 Jun 2017 02:28:37 +0000 (12:28 +1000)]
tools: update the publish-doc tool to use ninja

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: add a short blurb regarding lid switch handling
Peter Hutterer [Tue, 13 Jun 2017 02:20:34 +0000 (12:20 +1000)]
doc: add a short blurb regarding lid switch handling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: decouple our tests/test suites from the ones used by check
Peter Hutterer [Wed, 7 Jun 2017 03:30:48 +0000 (13:30 +1000)]
test: decouple our tests/test suites from the ones used by check

Check arranges the tests into suites and test cases (which then can have
multiple test functions). The primary feature for suites is the ability to
select them with environment variables and that the log messages are printed
per suite, not per test case.

We used the suites to distribute tests across the processes forked by the test
runner, but that also resulted in slow suites relying on timeouts (tap/dwt) to
take a lot longer than other suites and hold everything else up.

This patch basically drops the use of check test suites. Our test runner has a
--filter-group argument which selects on suite names, the log messages are
more useful if they immediately include the device and the test case name.

So we just save the test metatdata in our own struct and then assemble a
suite/test case on the fly for each test.

The advantage of this is that tests of the same suite are now distributed
across the forks so slow tests that rely on length timeouts are now run in
parallel. This brings the test runs down to under 6 min again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: free the tap data on error
Peter Hutterer [Mon, 12 Jun 2017 22:33:12 +0000 (08:33 +1000)]
tools: free the tap data on error

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: add missing toffset copy from src to dest while duplicating
Peter Hutterer [Mon, 12 Jun 2017 22:31:15 +0000 (08:31 +1000)]
tools: add missing toffset copy from src to dest while duplicating

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: point out that measuring taps may be different to what libinput sees
Peter Hutterer [Fri, 9 Jun 2017 05:00:36 +0000 (15:00 +1000)]
tools: point out that measuring taps may be different to what libinput sees

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: localise the open/close function counter in the path tests
Peter Hutterer [Fri, 9 Jun 2017 02:25:50 +0000 (12:25 +1000)]
test: localise the open/close function counter in the path tests

Reduces the chance of interference between tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: use unique names for all the test suite names
Peter Hutterer [Fri, 2 Jun 2017 06:59:09 +0000 (16:59 +1000)]
test: use unique names for all the test suite names

This makes it possible to run multiple test suite simultaneously on the same
host without messing up the other runs (provided that all instances use
the same udev/hwdb files). Previously, removing the udev rules/hwdb at the end
of a test run would cause test case failures in other runs that hadn't
completed yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agotest: remove unused devices field from struct test
Peter Hutterer [Wed, 7 Jun 2017 01:43:40 +0000 (11:43 +1000)]
test: remove unused devices field from struct test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoudev: Add specific pressure range for the Chromebook R13 CB5-312T
Paul Kocialkowski [Fri, 28 Apr 2017 13:33:01 +0000 (15:33 +0200)]
udev: Add specific pressure range for the Chromebook R13 CB5-312T

This adds specific pressure range values for the Elan touchpad found in
the Chromebook R13 CB5-312T (codename elm).

These values allow using the touchpad from the tip of the finger and
makes scrolling generally more reactive.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoudev: Add generic pressure range values for I2C Elan touchpads
Paul Kocialkowski [Fri, 28 Apr 2017 13:33:00 +0000 (15:33 +0200)]
udev: Add generic pressure range values for I2C Elan touchpads

This adds generic pressure range values for I2C Elan touchpads used
with device-tree. These values were tested to work with various devices
and should be acceptable in most cases.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoudev: Add support for device-tree-based model selection
Paul Kocialkowski [Fri, 28 Apr 2017 13:32:59 +0000 (15:32 +0200)]
udev: Add support for device-tree-based model selection

This adds support for detecting input peripherals based on their name
and the device-tree model of the device they're used with.

This is mostly an equivalent to dmi-based model detection (e.g. on x86
devices) for device that use device-tree (e.g. on ARM devices).

Note that this requires systemd updates, see
https://github.com/systemd/systemd/pull/5837

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: fix linker error with the debug-gui
Peter Hutterer [Tue, 6 Jun 2017 07:54:18 +0000 (17:54 +1000)]
tools: fix linker error with the debug-gui

Make sure we link libudev into everything that requires it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: link libinput.la for libshared.la
Peter Hutterer [Tue, 6 Jun 2017 05:20:40 +0000 (15:20 +1000)]
tools: link libinput.la for libshared.la

Hopefully fixes the Semaphore CI build failures, apparently things are a bit
more restrictive there than in Fedora 26.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoconfigure.ac: require libevdev 1.3 or later
Peter Hutterer [Tue, 6 Jun 2017 04:26:33 +0000 (14:26 +1000)]
configure.ac: require libevdev 1.3 or later

b5e3fd04b2ab667e844e34 added hooks for the libevdev log handler and that one
was added in libevdev 1.3 (released in Sep 2014).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: escape all dashes in man pages (for commands and options)
Peter Hutterer [Fri, 2 Jun 2017 02:15:50 +0000 (12:15 +1000)]
tools: escape all dashes in man pages (for commands and options)

Apparently the rule is that if a dash may end up being copy/pasted, it needs
to be escaped.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: man page cleanup - lowercase all command names
Peter Hutterer [Fri, 2 Jun 2017 02:10:03 +0000 (12:10 +1000)]
tools: man page cleanup - lowercase all command names

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: add "libinput measure touchpad-tap"
Peter Hutterer [Tue, 23 May 2017 05:07:31 +0000 (15:07 +1000)]
tools: add "libinput measure touchpad-tap"

This is the first tool of many more to come to enable users to gather
information aobut their devices and/or usage of these devices. Previously,
these required the users to record events, submit them to a bugzilla, have me
run various scripts over it and then decree that the scripts have spoken.
Push some of this into the hands of the users so they can query the numbers
locally and start investigating (or at least get an idea of what's happening).

This tool measures the time deltas between touch up and touch down and prints
a basic summary, together with the ability to print a dat file with the data
for visualization by e.g. gnuplot. Eventually, more of the current analysis
scripts will be moved into this or other helpers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoAdd tv2us helper function
Peter Hutterer [Thu, 25 May 2017 22:56:29 +0000 (08:56 +1000)]
Add tv2us helper function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: link to the online documentation from the libinput(1) man page
Peter Hutterer [Thu, 25 May 2017 07:46:07 +0000 (17:46 +1000)]
tools: link to the online documentation from the libinput(1) man page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: split the install_man() up for better grouping of tools
Peter Hutterer [Thu, 25 May 2017 07:33:03 +0000 (17:33 +1000)]
tools: split the install_man() up for better grouping of tools

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: make the libinput tool usage static
Peter Hutterer [Thu, 25 May 2017 06:07:14 +0000 (16:07 +1000)]
tools: make the libinput tool usage static

This now makes the header obsolete too

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: Reinstate libshared.la and add it to meson.build too
Peter Hutterer [Thu, 25 May 2017 05:47:19 +0000 (15:47 +1000)]
tools: Reinstate libshared.la and add it to meson.build too

Removed with commit 863fd1f0ebf145dc2b3a59e2a3e57dbc4ce77eaf but now that we
exec each subcommand, the previous per-target compilation flags aren't needed
anymore. Build a static library to avoid rebuilding the source files for each
target.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: update for the new libinput tool
Peter Hutterer [Wed, 24 May 2017 01:12:28 +0000 (11:12 +1000)]
doc: update for the new libinput tool

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: tidy up the usage() for the tools a bit
Peter Hutterer [Thu, 25 May 2017 05:42:46 +0000 (15:42 +1000)]
tools: tidy up the usage() for the tools a bit

Now that the debug-gui is a user-visible tool, make sure the usage reflects
the right command name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoFold the event-gui into the libinput tool
Peter Hutterer [Wed, 24 May 2017 00:36:44 +0000 (10:36 +1000)]
Fold the event-gui into the libinput tool

It's common enough for users to want to debug libinput behavior without
interference by the compositor or the X server. Being able to run a GUI
without having to compile from git is helpful.

Note that this changes --enable-event-gui autotools option to
--enable-debug-gui and the event-gui mesonconf option to debug-gui.

This also drops the standalone event-gui binary in both autotools and meson.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: switch the libinput tool to be an exec-ing tool
Peter Hutterer [Thu, 25 May 2017 00:12:26 +0000 (10:12 +1000)]
tools: switch the libinput tool to be an exec-ing tool

Chaining args together inside a single binary would be nice, but it gets nasty
quickly (as I found out adding 3, 4 extra commands). Switch over to using a
git-style exec-ing command where libinput merely changes argv[0] and then
executes whatever it assembled. And those binaries can hide in libexec so they
don't clutter up the global namespace.

This also makes it a lot easier to write man pages, adopt the same style as
git uses.

Compatibilty wrapper scripts are provided for libinput-list-devices and
libinput-debug events. These warn the user about the changed command, then
exec the new one. Expect these wrappers to be removed at some point in the
future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: drop event-debug
Peter Hutterer [Wed, 24 May 2017 00:17:46 +0000 (10:17 +1000)]
tools: drop event-debug

It's the same thing as libinput-debug-events and the newer "libinput
debug-events" command. The only reason it existed after we started providing
libinput-debug-events is the -no-install libtool flag that makes debugging
with gdb bearable.

Now that we're slowly moving to meson, this isn't needed anymore. If you want
to gdb directly in the source tree, build with meson.
Or use "libtool --mode=execute gdb" for an autotools build.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomeson: add a test setup for valgrind
Peter Hutterer [Thu, 1 Jun 2017 23:35:56 +0000 (09:35 +1000)]
meson: add a test setup for valgrind

To run valgrind properly, we need a couple of arguments passed in so we check
for leaks and don't fail on bits of the stack we don't control. Add a
mesontest setup for this, the lot can now be run by

   mesontest --setup=valgrind

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>