platform/upstream/libinput.git
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>
7 years agomeson: drop LITEST_VERBOSE environment variable
Peter Hutterer [Thu, 1 Jun 2017 22:32:22 +0000 (08:32 +1000)]
meson: drop LITEST_VERBOSE environment variable

Removed from autotools in 1f5c5cf2c but somehow made a comeback

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: remove unused litest_handle_events
Peter Hutterer [Thu, 1 Jun 2017 22:14:26 +0000 (08:14 +1000)]
test: remove unused litest_handle_events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: limit the wait_for_event timeout to 2s
Peter Hutterer [Thu, 1 Jun 2017 05:43:14 +0000 (15:43 +1000)]
test: limit the wait_for_event timeout to 2s

No internal timeout we have takes longer than 2s, so we can abort if we don't
succeed. This gives us a better backtrace to figure out where we're hanging
than the SIGABRT that check will eventually send us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: don't leak test warnings to stdout
Peter Hutterer [Thu, 1 Jun 2017 05:00:27 +0000 (15:00 +1000)]
test: don't leak test warnings to stdout

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoevdev: hook up the libevdev log handler
Peter Hutterer [Thu, 1 Jun 2017 05:26:51 +0000 (15:26 +1000)]
evdev: hook up the libevdev log handler

Make sure any messages from libevdev end up in the same place as libinput's
messages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: drop two superfluous empty queue checks
Peter Hutterer [Tue, 30 May 2017 03:02:28 +0000 (13:02 +1000)]
test: drop two superfluous empty queue checks

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: tighten some test cases
Peter Hutterer [Tue, 30 May 2017 00:13:32 +0000 (10:13 +1000)]
test: tighten some test cases

Instead of just waiting for events, use a libinput_dispatch() and assume the
event is there when we want it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: add an extra assert into litest_wait_for_event_of_type
Peter Hutterer [Tue, 30 May 2017 05:26:16 +0000 (15:26 +1000)]
test: add an extra assert into litest_wait_for_event_of_type

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: make sure we search for event node, not the parent input device
Peter Hutterer [Wed, 31 May 2017 02:01:16 +0000 (12:01 +1000)]
test: make sure we search for event node, not the parent input device

This explains the heisenbugs when running the test suite. libevdev gives us
the syspath to the /sys/.../input123 node, not the one for the event node.
The device node path is created based on the sysfs tree, so there's a
window where the device node may not exist yet but we already returned the
device node path.

In litest, we're using a udev monitor to wait until the device is ready for
us, but the path interface only takes a device node path. So what happens is:
* libevdev gives us a syspath for the input node and a device path
* the monitor receives the input node udev device and matches the syspath
* we pass that up to the caller litest_add_device_with_overrides()
  which opens the device node and adds it to libinput
* the path interface creates a udev device from the device node, which still
  points to the old device node. Things fail because we don't have the device
  we expect or it doesn't send events and eventually times out [1].

The errors triggered by this are either odd udev property mismatches or
timeouts because events are never processed.

This race is fixed by simply constructing the actual device node path we
expect from the udev device and waiting for the right device.

[1] We rely on the caller to notify us when to remove the device and thus
silently ignore ENODEV.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoMerge branch 'wip/keyboard-integration-property'
Peter Hutterer [Mon, 29 May 2017 03:20:39 +0000 (13:20 +1000)]
Merge branch 'wip/keyboard-integration-property'

7 years agotools: fix minor coding style issue
Peter Hutterer [Thu, 25 May 2017 05:34:30 +0000 (15:34 +1000)]
tools: fix minor coding style issue

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: fix return codes on failure
Peter Hutterer [Wed, 24 May 2017 23:32:13 +0000 (09:32 +1000)]
tools: fix return codes on failure

Leftovers from an earlier version where we had booleans and more function
nesting in the mix. Fix to return integers, and also rename the function name
accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoRevert "lid: force the lid to open when the keyboard device is removed"
Peter Hutterer [Tue, 23 May 2017 03:06:44 +0000 (13:06 +1000)]
Revert "lid: force the lid to open when the keyboard device is removed"

This reverts commit 1e2b66fb9a0de8956abc7d996afdd24a11893eb6.

7 years agolid: force the lid to open when the keyboard device is removed
Peter Hutterer [Mon, 22 May 2017 06:00:20 +0000 (16:00 +1000)]
lid: force the lid to open when the keyboard device is removed

On unreliable tablets (Surface3), always force the lid switch to open when the
paired keyboard is removed. This way the lid can't be stuck in a closed state
when there's nothing attached that can actually trigger that state.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolid: setup the keyboard notifier when pairing it
Benjamin Tissoires [Fri, 19 May 2017 10:57:23 +0000 (12:57 +0200)]
lid: setup the keyboard notifier when pairing it

On unreliable LID switches, we might have the LID declared as closed
while it is actually not. We can not wait for the first switch event to setup
the keyboard listener: it will never occur.

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

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolid: track the notifier initial state internally, but not externally
Benjamin Tissoires [Fri, 19 May 2017 10:55:54 +0000 (12:55 +0200)]
lid: track the notifier initial state internally, but not externally

What we do not want is libinput to believe the LID is closed while
it's not. But the internal notifier state need to be in sync with the evdev
node, or it's going to be a pain setting the keyboard listener.

But since we don't know if the state is reliable, we track the internal state
separately from the external state so that we can set up the keyboard listener
when the lid is closed, without having libinput actually send lid closed
events for unreliable devices.

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

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolid: tighten the lid-keyboard pairing
Peter Hutterer [Mon, 22 May 2017 03:51:11 +0000 (13:51 +1000)]
lid: tighten the lid-keyboard pairing

Only pair if the keyboard is either tagged as internal device.

This has another (unlikely) behaviour change: previously we would override the
paired keyboards with ones that look more accurate (e.g. a usb keyboard paired
before a serial would be unpaired and the serial keyboard takes its place).
Now we assume there can only be one internal keyboard, once we have it we
ignore all others. This shouldn't matter in real life provided the tagging is
correct.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoevdev: read LIBINPUT_ATTR_KEYBOARD_INTEGRATION property
Peter Hutterer [Mon, 22 May 2017 03:34:10 +0000 (13:34 +1000)]
evdev: read LIBINPUT_ATTR_KEYBOARD_INTEGRATION property

We have heuristics for detecting whether a keyboard is internal or external,
but in some cases (e.g. Surface 3) these heuristics fail. Add a udev property
that we can apply to these cases so we have something that's reliable.

This will likely eventually become ID_INPUT_KEYBOARD_INTEGRATION as shipped by
systemd, similar to the touchpad property.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolid: add a comment for why we post the switch state there
Peter Hutterer [Mon, 22 May 2017 04:28:31 +0000 (14:28 +1000)]
lid: add a comment for why we post the switch state there

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoMerge branch 'wip/libinput-tool-v2'
Peter Hutterer [Tue, 23 May 2017 03:37:06 +0000 (13:37 +1000)]
Merge branch 'wip/libinput-tool-v2'

7 years agotest: tighten the wakeup-on-key lid test
Peter Hutterer [Mon, 22 May 2017 04:21:40 +0000 (14:21 +1000)]
test: tighten the wakeup-on-key lid test

Having a litest_wait_for_event_of_type() in there causes us to silently
discard anything but the events we're looking for. This is risky, we want to
make sure that if we re-enable the lid that the key events arrive *after* the
lid open event, not before. So let's not paper over those.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: fix a lid test
Peter Hutterer [Mon, 22 May 2017 04:03:38 +0000 (14:03 +1000)]
test: fix a lid test

We were checking for the empty queue on the wrong context, the default context
got drained a few lines above.

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