platform/upstream/libinput.git
6 years agoCI: speed up the docker_check stage
Benjamin Tissoires [Mon, 18 Jun 2018 07:34:10 +0000 (09:34 +0200)]
CI: speed up the docker_check stage

There is no point in login in to the registry if there is no need to
create a new docker image.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agoCI: do not pull images when checking for the creation date
Benjamin Tissoires [Fri, 15 Jun 2018 20:15:40 +0000 (22:15 +0200)]
CI: do not pull images when checking for the creation date

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agodoc: point to the gitlab ci file for a list of required packages
Peter Hutterer [Tue, 19 Jun 2018 03:27:42 +0000 (13:27 +1000)]
doc: point to the gitlab ci file for a list of required packages

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: remove a compiler warning
Peter Hutterer [Tue, 19 Jun 2018 03:13:24 +0000 (13:13 +1000)]
test: remove a compiler warning

Leftover from a previous iteration of this code - having a static but
unnecessarily large size for dirname results in:

../test/litest.c:1251:38: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
   snprintf(dest, sizeof(dest), "%s/%s", dirname, filename);
                                      ^
../test/litest.c:1251:3: note: ‘snprintf’ output 2 or more bytes (assuming 4097) into a destination of size 4096
   snprintf(dest, sizeof(dest), "%s/%s", dirname, filename);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add more assertion to avoid API misusage (v2)
Peter Hutterer [Tue, 19 Jun 2018 03:07:12 +0000 (13:07 +1000)]
quirks: add more assertion to avoid API misusage (v2)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "quirks: add more assertion to avoid API misusage"
Peter Hutterer [Mon, 18 Jun 2018 10:55:03 +0000 (20:55 +1000)]
Revert "quirks: add more assertion to avoid API misusage"

Ooops, this clearly didn't get tested and now aborts libinput list-quirks

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/47

This reverts commit 2c4f963b18ff7f36cc14994c8b18bc4e4754ddde.

6 years agotest: pass the open mode to open(O_CREAT)
Peter Hutterer [Mon, 18 Jun 2018 03:41:18 +0000 (13:41 +1000)]
test: pass the open mode to open(O_CREAT)

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add more assertion to avoid API misusage
Peter Hutterer [Mon, 18 Jun 2018 03:35:34 +0000 (13:35 +1000)]
quirks: add more assertion to avoid API misusage

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: explicitly cast the log priority
Peter Hutterer [Mon, 18 Jun 2018 03:27:57 +0000 (13:27 +1000)]
quirks: explicitly cast the log priority

The values are the same and this is ABI so they will never change. Make the
cast explicit for coverity's benefit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirk: remove unused variable
Peter Hutterer [Mon, 18 Jun 2018 03:25:02 +0000 (13:25 +1000)]
quirk: remove unused variable

Also fixes a coverity complaint about incrementing an uninitialized variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agogitlab ci: use GIT_DEPTH of 1
Peter Hutterer [Mon, 18 Jun 2018 02:35:42 +0000 (12:35 +1000)]
gitlab ci: use GIT_DEPTH of 1

We don't need the full repo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoDrop the udev hwdb model quirks
Peter Hutterer [Mon, 18 Jun 2018 01:04:43 +0000 (11:04 +1000)]
Drop the udev hwdb model quirks

Replaced with the quirks files in merge commit
000ac14c27f1920fc84c0ecb1512eb7495e67634

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRemove circle.yml
Peter Hutterer [Mon, 18 Jun 2018 01:00:23 +0000 (11:00 +1000)]
Remove circle.yml

This has been replaced with the GitLab CI in the repository proper. Circle CI
was ony ever run on a private github repo.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/quirks-fixes'
Peter Hutterer [Mon, 18 Jun 2018 00:55:27 +0000 (10:55 +1000)]
Merge branch 'wip/quirks-fixes'

6 years agodata: don't disable the keyboard on any Thinkpad Yoga models
Peter Hutterer [Thu, 14 Jun 2018 01:33:41 +0000 (11:33 +1000)]
data: don't disable the keyboard on any Thinkpad Yoga models

These (probably) all disable the mechanical keyboard anyway, so let's keep it
enabled to be able to access the screen keys, if any.

https://gitlab.freedesktop.org/libinput/libinput/issues/39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: add the alps firmware version LUT
Peter Hutterer [Thu, 14 Jun 2018 01:57:42 +0000 (11:57 +1000)]
data: add the alps firmware version LUT

Just in case we need it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: put a 'do not edit' warning into all data files
Peter Hutterer [Thu, 14 Jun 2018 01:54:52 +0000 (11:54 +1000)]
data: put a 'do not edit' warning into all data files

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: add ALPS v8 trackpoint range
Peter Hutterer [Thu, 14 Jun 2018 01:48:33 +0000 (11:48 +1000)]
data: add ALPS v8 trackpoint range

Got lost in the hwdb to quirks conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: re-add the ALPS v8 size hint
Peter Hutterer [Thu, 14 Jun 2018 01:47:50 +0000 (11:47 +1000)]
data: re-add the ALPS v8 size hint

Got lost in the udev to quirks file conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: switch alps touchpad matching to the bus/vid/pid matching
Peter Hutterer [Thu, 14 Jun 2018 01:44:48 +0000 (11:44 +1000)]
data: switch alps touchpad matching to the bus/vid/pid matching

PSMOUSE_ALPS is 0x8

https://gitlab.freedesktop.org/libinput/libinput/issues/30

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add MatchVersion in addition to VID/PID
Peter Hutterer [Thu, 14 Jun 2018 01:42:27 +0000 (11:42 +1000)]
quirks: add MatchVersion in addition to VID/PID

Needed for the ALPS firmware detection in #39

https://gitlab.freedesktop.org/libinput/libinput/issues/39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: re-add the IBM X41 quirk
Peter Hutterer [Thu, 14 Jun 2018 01:36:44 +0000 (11:36 +1000)]
data: re-add the IBM X41 quirk

Was merged while the config branch was ongoing and got lost in the process.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoCI: Hook up GitLab CI
Benjamin Tissoires [Mon, 11 Jun 2018 09:22:41 +0000 (11:22 +0200)]
CI: Hook up GitLab CI

The main tasks it does is build on a few different distros as well as build
with the various build options to make sure they work.It doesn't (yet) run the
test suite runner because that one mostly requires device nodes to operate on.

Most of the fancy is to get the docker images ready. A dnf update takes
forever, so we don't want to do that on 10 different machines. So instead we
build docker images with all the bits pre-installed, push that to the registry
and use those images for testing.

To speed things up, we only do that when the current image is older than a
week. And we only do that when we push to libinput proper, so a merge request
or pushing to your private gitlab repo will never trigger a docker image
update - it will trigger the tests and use the docker images tough.

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 years agotools: measure touchpad-pressure: prevent division by zero
Peter Hutterer [Sun, 17 Jun 2018 22:38:58 +0000 (08:38 +1000)]
tools: measure touchpad-pressure: prevent division by zero

And make sure the equivalent entry in the measure touch-size is long enough to
overwrite the current status line

https://gitlab.freedesktop.org/libinput/libinput/issues/42

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: ignore motion on finger-up
Konstantin Kharlamov [Wed, 13 Jun 2018 11:38:20 +0000 (14:38 +0300)]
touchpad: ignore motion on finger-up

Ignore motion when pressure/touch size fell below the threshold, thus
ending the touch.

Real world significance: subjectively scrolling/cursor positioning with
a touchpad now a bit better on SAMSUNG NP305V5A laptop.

https://gitlab.freedesktop.org/libinput/libinput/merge_requests/4

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
6 years agoquirks: use realloc instead of reallocarray
Peter Hutterer [Thu, 14 Jun 2018 21:59:06 +0000 (07:59 +1000)]
quirks: use realloc instead of reallocarray

The latter requires libbsd and for that one call it's not worth it

https://gitlab.freedesktop.org/libinput/libinput/issues/40

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix a test device section name
Peter Hutterer [Thu, 14 Jun 2018 05:16:03 +0000 (15:16 +1000)]
test: fix a test device section name

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix the input_id struct for the ALPS touchpad
Peter Hutterer [Thu, 14 Jun 2018 05:17:46 +0000 (15:17 +1000)]
test: fix the input_id struct for the ALPS touchpad

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agomeson.build: always build some tests
Peter Hutterer [Thu, 14 Jun 2018 04:48:49 +0000 (14:48 +1000)]
meson.build: always build some tests

Make the meson -Dtests=false option only apply to the libinput test suite
itself which has extra dependencies, etc. The build tests and symbol leak
tests should always run.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodata: add pressure range/palm threshold for the Dell XPS13 9333
Peter Hutterer [Thu, 14 Jun 2018 00:04:35 +0000 (10:04 +1000)]
data: add pressure range/palm threshold for the Dell XPS13 9333

https://gitlab.freedesktop.org/libinput/libinput/issues/37

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: fix grab argument passing for libinput debug-events
Peter Hutterer [Wed, 13 Jun 2018 03:38:09 +0000 (13:38 +1000)]
tools: fix grab argument passing for libinput debug-events

The &grab pointer we used to pass as userdata was the address of the function
argument which goes out of scope at the end of the function. This works fine
for devices immediately opened but when a device connects later, the address
may have been re-used since and it's content is undefined. If not NULL, we
end up grabbing the device.

Instead pass the grab option in which is guaranteed to live until the end of
main.

https://gitlab.freedesktop.org/libinput/libinput/issues/26

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMove CODING_STYLE to markdown
Peter Hutterer [Wed, 13 Jun 2018 22:39:28 +0000 (08:39 +1000)]
Move CODING_STYLE to markdown

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: replace last_point with history.samples
Konstantin Kharlamov [Tue, 12 Jun 2018 15:53:51 +0000 (18:53 +0300)]
touchpad: replace last_point with history.samples

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
6 years agomeson.build: bump to 1.11.900
Peter Hutterer [Wed, 13 Jun 2018 05:45:27 +0000 (15:45 +1000)]
meson.build: bump to 1.11.900

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agocircleci: drop the separate libsolv update
Peter Hutterer [Wed, 13 Jun 2018 05:22:24 +0000 (15:22 +1000)]
circleci: drop the separate libsolv update

This was a F26 bug that is well and truly in stable by now
https://bugzilla.redhat.com/show_bug.cgi?id=1483553

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/config-files'
Peter Hutterer [Mon, 11 Jun 2018 03:45:50 +0000 (13:45 +1000)]
Merge branch 'wip/config-files'

6 years agotools: libinput-record: put extra guard in to protect from OOB access
Peter Hutterer [Mon, 11 Jun 2018 01:20:09 +0000 (11:20 +1000)]
tools: libinput-record: put extra guard in to protect from OOB access

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: abort for a negative zalloc() size
Peter Hutterer [Mon, 11 Jun 2018 01:13:03 +0000 (11:13 +1000)]
util: abort for a negative zalloc() size

Nothing in libinput needs large buffers, so if we ever get something that
large, we probably passed a negative number to zalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: put limits on how many strings we join
Peter Hutterer [Mon, 11 Jun 2018 03:43:20 +0000 (13:43 +1000)]
util: put limits on how many strings we join

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add null string test handling to strv_join
Peter Hutterer [Mon, 11 Jun 2018 00:45:58 +0000 (10:45 +1000)]
util: add null string test handling to strv_join

Make it return NULL for a string array in the form of [ NULL ], like the docs
say. This also adds an extra safety check for the joiner to be of a reasonable
length to avoid overflows.

Found in
https://gitlab.freedesktop.org/libinput/libinput/issues/26#note_6320

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: don't pair external touchpads with lid/tablet mode switches
Peter Hutterer [Fri, 8 Jun 2018 05:15:24 +0000 (15:15 +1000)]
touchpad: don't pair external touchpads with lid/tablet mode switches

https://gitlab.freedesktop.org/libinput/libinput/issues/29

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoHook up list-quirks --validate for the test suite
Peter Hutterer [Wed, 6 Jun 2018 04:39:39 +0000 (14:39 +1000)]
Hook up list-quirks --validate for the test suite

All the tests fill fail anyway if the validation fails but this is a quick way
to fail everything early.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add the devicetree implementation
Peter Hutterer [Mon, 4 Jun 2018 01:18:02 +0000 (11:18 +1000)]
quirks: add the devicetree implementation

Using the compatible string

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoSwitch from udev property parsing to the quirks system
Peter Hutterer [Thu, 24 May 2018 01:56:24 +0000 (11:56 +1000)]
Switch from udev property parsing to the quirks system

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: initialize the quirks subsystem
Peter Hutterer [Thu, 24 May 2018 01:46:31 +0000 (11:46 +1000)]
libinput: initialize the quirks subsystem

A bit quirky (haha), because we cannot do this during context creation - we
really want any parsing error messages to show up in the right log file and
the log handler isn't set up during context creation. So we do it on the first
real call to the backend - path_add_device or udev_assign_seat.

Also, failure to initialize the quirks subsystem just means we continue as
normal. This shouldn't be a hard failure, it just means a lot of devices won't
work properly.

If the LIBINPUT_DATA_DIR environment variable is set, that directory is used
for the data file. Only that directory, no custom override file in that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: switch the udev tag tests to be quirk tests
Peter Hutterer [Fri, 25 May 2018 00:01:47 +0000 (10:01 +1000)]
test: switch the udev tag tests to be quirk tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: init the quirks once per test suite run
Peter Hutterer [Thu, 24 May 2018 06:52:42 +0000 (16:52 +1000)]
test: init the quirks once per test suite run

So we have them available per litest device and can check in tests for certain
quirks to be present.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: install per-test device quirks files
Peter Hutterer [Thu, 24 May 2018 05:36:22 +0000 (15:36 +1000)]
test: install per-test device quirks files

These will replace the custom udev rules we currently have in place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: allow for in-line comments
Peter Hutterer [Wed, 30 May 2018 23:42:15 +0000 (09:42 +1000)]
quirks: allow for in-line comments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: use an empty dmi modalias string for the test suite
Peter Hutterer [Thu, 24 May 2018 23:23:50 +0000 (09:23 +1000)]
quirks: use an empty dmi modalias string for the test suite

We don't want any of the test devices to match the local machine's DMI
modalias. This was a major drawback in the previous test suite, hacking the
dmi modalias string was nontrivial but a wrong string could cause false
positives or negatives.

The quirks system is internal, so rather than having some fancy API we just
hook it off the environment variable that the test suite always sets. Hacky,
but a lot easier than the other options.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoImplement a quirks system to replace the udev property parsing
Peter Hutterer [Mon, 21 May 2018 04:28:53 +0000 (14:28 +1000)]
Implement a quirks system to replace the udev property parsing

Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.

This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.

The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.

Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.

THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: remove duplicate Chromebook Falco hwdb entry
Peter Hutterer [Wed, 30 May 2018 05:23:21 +0000 (15:23 +1000)]
udev: remove duplicate Chromebook Falco hwdb entry

We can expand the first one and re-use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a safe_atou() as unsigned equivalent to safe_atoi()
Peter Hutterer [Fri, 1 Jun 2018 00:21:18 +0000 (10:21 +1000)]
util: add a safe_atou() as unsigned equivalent to safe_atoi()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a list_append()
Peter Hutterer [Wed, 23 May 2018 05:21:56 +0000 (15:21 +1000)]
util: add a list_append()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: remove created directories too
Peter Hutterer [Thu, 24 May 2018 04:49:22 +0000 (14:49 +1000)]
test: remove created directories too

If we created it, remove it again. No change because we're not adding any of
the directories yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: make litest_copy_file copy normal files too
Peter Hutterer [Thu, 24 May 2018 04:47:30 +0000 (14:47 +1000)]
test: make litest_copy_file copy normal files too

Make the tempfile creation dependent on whether the required template is
present. Currently unused, this is just prep work for future patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoCOPYING: change a cgit to a gitlab URL
Peter Hutterer [Wed, 6 Jun 2018 01:17:54 +0000 (11:17 +1000)]
COPYING: change a cgit to a gitlab URL

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: drop the publish-doc tool
Peter Hutterer [Wed, 6 Jun 2018 01:15:38 +0000 (11:15 +1000)]
tools: drop the publish-doc tool

libinput docs must be pushed to wayland's web git repository now

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: Fix URLs for GitLab, HTTPS
Daniel Stone [Tue, 5 Jun 2018 10:07:16 +0000 (11:07 +0100)]
doc: Fix URLs for GitLab, HTTPS

The GitLab migrations means that bugs should now be reported there
rather than Bugzilla. Though the repository is still available via
anongit, cloning through GitLab allows use of HTTPS.

All freedesktop.org URLs are also preferentially served over HTTPS
rather than unsecured HTTP.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agofilter: cap trackpoint scale factor at 1.0
Peter Hutterer [Mon, 4 Jun 2018 03:36:08 +0000 (13:36 +1000)]
filter: cap trackpoint scale factor at 1.0

Otherwise we scale up lower-resolution trackpoints' movements, resulting in a
jumpy cursor.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: the IBM X41 Tablet must not disable the keyboard in tablet mode
Peter Hutterer [Sun, 3 Jun 2018 22:16:48 +0000 (08:16 +1000)]
udev: the IBM X41 Tablet must not disable the keyboard in tablet mode

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.11.0 1.11.0
Peter Hutterer [Mon, 4 Jun 2018 00:16:55 +0000 (10:16 +1000)]
libinput 1.11.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: point at --verbose for libinput debug-events
Peter Hutterer [Sun, 3 Jun 2018 23:21:20 +0000 (09:21 +1000)]
doc: point at --verbose for libinput debug-events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: improve the 'tools' page
Peter Hutterer [Sun, 3 Jun 2018 23:20:15 +0000 (09:20 +1000)]
doc: improve the 'tools' page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "udev: copy the trackpoint sensitivity directly from sysfs"
Peter Hutterer [Fri, 1 Jun 2018 01:19:49 +0000 (11:19 +1000)]
Revert "udev: copy the trackpoint sensitivity directly from sysfs"

The lenovo compact keyboard with trackpoint has a sensitivity of 5, which
causes the trackpoint range to be 0. This in turn causes inf/NaN during
pointer acceleration as we divide by 0 and makes the cursor go unpredictably
somewhere it probably shouldn't be.

This is part of a wider problem in that the current sensitivity handling
doesn't work well for values well below the default of 128. Any such values
are scaled up to multiples of pixels instead of just working as-is.

Reverting the automatic sensitivity parsing, any systemd udev property set to
change the sensitivity increases it, so we don't run into this bug.

https://bugzilla.redhat.com/show_bug.cgi?id=1583324

This reverts commit a4036a33ca6ca8da7d2417cac6b840a89b295e5f.

6 years agoevdev: don't allow a trackpoint range of 0
Peter Hutterer [Fri, 1 Jun 2018 02:47:42 +0000 (12:47 +1000)]
evdev: don't allow a trackpoint range of 0

https://bugzilla.redhat.com/show_bug.cgi?id=1583324

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: move the "Users" section to the top of the "pages" section
Peter Hutterer [Fri, 1 Jun 2018 03:16:08 +0000 (13:16 +1000)]
doc: move the "Users" section to the top of the "pages" section

On the off-chance that someone actually looks at this page, let's put the
comment most at risk by a TLDR attention span at the top.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: drop the JUMPING_SEMI_MT quirk, no-one uses it
Peter Hutterer [Wed, 30 May 2018 01:14:52 +0000 (11:14 +1000)]
udev: drop the JUMPING_SEMI_MT quirk, no-one uses it

Obsolete since 342bc510164e89d7c9a742406fb98f9deabf5c8f when we disabled MT on
all semi-mt touchpads.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: drop the custom firmware detection code in favor of a modalias
Peter Hutterer [Wed, 30 May 2018 00:50:05 +0000 (10:50 +1000)]
udev: drop the custom firmware detection code in favor of a modalias

This was overengineered. The separation between the model quirks file and the
udev hwdb matches allowed for more complex firmware detection. Except we never
used it anywhere but on ALPS and there we can, thankfully, just get it from
the version number in the input_id field exposed in the modalias.

So let's drop this and use that match instead. We just need an extra udev rule
to match on ID_INPUT_POINTINGSTICKs so we can differ between ALPS touchpads
and ALPS trackpoints.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.10.902 1.10.902
Peter Hutterer [Mon, 28 May 2018 23:15:10 +0000 (09:15 +1000)]
libinput 1.10.902

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: replace the hardcoded thumb threshold with a udev prop
Peter Hutterer [Wed, 23 May 2018 23:52:17 +0000 (09:52 +1000)]
touchpad: replace the hardcoded thumb threshold with a udev prop

LIBINPUT_ATTR_THUMB_PRESSURE_THRESHOLD now determines whether we do thumb
pressure detection or not. Much better than having a hardcoded default that
may or may not be correct on any given device.

This patch is likely to break thumb detection on some touchpads, the only
property so far is to restore the default of 100 for all Lenovo Thinkpad
touchpads. More rules are needed, we'll just wait until someone shouts.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRestore the old trackpoint pointer accel picture
Peter Hutterer [Mon, 28 May 2018 03:54:27 +0000 (13:54 +1000)]
Restore the old trackpoint pointer accel picture

Accidentally updated the wrong picture. This reverts part of commit
d6e531349745ff38ae457169d5089ea61297accf.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: update the touchpad pointer acceleration graphs
Peter Hutterer [Mon, 28 May 2018 03:52:10 +0000 (13:52 +1000)]
doc: update the touchpad pointer acceleration graphs

Part of d6e531349745ff38ae457169d5089ea61297accf but I updated the wrong svg
in that commit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: make the dwt paired keyboard list a struct list
Peter Hutterer [Mon, 28 May 2018 01:46:59 +0000 (11:46 +1000)]
touchpad: make the dwt paired keyboard list a struct list

This removes the artificial 3 keyboard limit. If you have more internal
keyboards than that, something is wrong in your setup but that shouldn't stop
us from working. Or more specificially: this can happen easily when running
tests so let's not fail the test suite because we created a few hundred
keyboards.

We'll still throw out a log message though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agofallback: make the paired keyboard list a struct list
Peter Hutterer [Mon, 28 May 2018 01:27:06 +0000 (11:27 +1000)]
fallback: make the paired keyboard list a struct list

This removes the artificial 3 keyboard limit. If you have more internal
keyboards than that, something is wrong in your setup but that shouldn't stop
us from working. Or more specificially: this can happen easily when running
tests so let's not fail the test suite because we created a few hundred
keyboards.

We'll still throw out a log message though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotablet: increase the proximity timeout during test runs
Peter Hutterer [Mon, 28 May 2018 00:38:12 +0000 (10:38 +1000)]
tablet: increase the proximity timeout during test runs

This is causing too many false positives and they're not easy to filter out.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: default to a trackpoint range of 160 for the new ALPS trackpoints
Peter Hutterer [Fri, 25 May 2018 06:37:05 +0000 (16:37 +1000)]
udev: default to a trackpoint range of 160 for the new ALPS trackpoints

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: support firmware detection for pointing sticks
Martin Wilck [Tue, 29 May 2018 07:28:09 +0000 (09:28 +0200)]
udev: support firmware detection for pointing sticks

Add support for firmware detection on pointing stick devices. This
is needed for ALPS only at this time.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput-measure-trackpoint-range: minimum delta measurement
Martin Wilck [Wed, 16 May 2018 14:25:12 +0000 (16:25 +0200)]
libinput-measure-trackpoint-range: minimum delta measurement

libinput-measure-trackpoint-range doesn't work well for ALPS
touchsticks that have minimum delta amplitude of ~8. Fix that
by analyzing min and max amplitude (radius) of the measured deltas,
and suggesting a high trackpoint range value if ALPS-typical behavior
is encountered. Also, suggest a different calibration procedure
to the user; rather then just calibrating quick movements, slow, gentle
movements should also be covered.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput-measure-trackpoint-range: fix typo
Martin Wilck [Wed, 16 May 2018 14:19:10 +0000 (16:19 +0200)]
libinput-measure-trackpoint-range: fix typo

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix udev prop test for apple touchpads
Peter Hutterer [Fri, 25 May 2018 03:17:34 +0000 (13:17 +1000)]
test: fix udev prop test for apple touchpads

Clearly a copy/paste error.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix udev rule for the gpio keys test device
Peter Hutterer [Thu, 24 May 2018 02:34:16 +0000 (12:34 +1000)]
test: fix udev rule for the gpio keys test device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: fix entry for Lenovo X280, missing dmi: prefix
Peter Hutterer [Thu, 24 May 2018 01:14:00 +0000 (11:14 +1000)]
udev: fix entry for Lenovo X280, missing dmi: prefix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.10.901 1.10.901
Peter Hutterer [Tue, 22 May 2018 01:13:27 +0000 (11:13 +1000)]
libinput 1.10.901

6 years agoBump TRACKPOINT_DEFAULT_MAX_DELTA to 120
Chow Loong Jin [Thu, 17 May 2018 19:11:57 +0000 (03:11 +0800)]
Bump TRACKPOINT_DEFAULT_MAX_DELTA to 120

This raises the trackpoint speed limit to something more conducive to
long-distance moves.

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

Signed-off-by: Chow Loong Jin <hyperair@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/custom-pointer-accel-revert'
Peter Hutterer [Mon, 21 May 2018 02:19:30 +0000 (12:19 +1000)]
Merge branch 'wip/custom-pointer-accel-revert'

6 years agoMerge branch 'wip/touchpad-pointer-accel-v7'
Peter Hutterer [Mon, 21 May 2018 02:19:17 +0000 (12:19 +1000)]
Merge branch 'wip/touchpad-pointer-accel-v7'

6 years agofilter: improve touchpad acceleration
Peter Hutterer [Mon, 12 Mar 2018 05:24:07 +0000 (15:24 +1000)]
filter: improve touchpad acceleration

This seems to give me roughly the same behaviour as macos does on the default
0 speed setting.

* Default speed is lower than before by around 30% [1]
* Acceleration kicks in much sooner (130mm/s vs 250mm/s before)
* Acceleration kicks in slower at lower speeds, so the change from 130mm/s to
  150mm/s is less than that of 320mm/s to 350mm/s
* The effect of the speed setting is a wide-range constant (de|ac)celeration
  [2], which means:
  * The unaccelerated baseline up until the threshold now changes with the
    speed setting
  * The threshold is now the same for all speeds
  * The range of the speed setting should now easily cover all desired device
    speeds.
  * Acceleration is steeper at higher speeds
* Deceleration was left as-is.

[1] This may or may not fix the jumping pointer issues caused by the previous
high defaults. When you have high default acceleration you move the finger
slower. This slow movement caused some touchpads (mostly seen on Lenovos) to
create pointer jumps. These weren't seen on synaptics previously because of a
combination of higher user finger speed (thus not triggering the bug) or just
not being as obvious (2px jump vs 10 px jump).

[2] The speed setting is actually a curve, the closer you get to 1.0 the more
difference you see between two different values. The curve's points are:
-1/0, 0/1, 1/5, so the resolution is closer for slow speeds. We still have
double resolution on the setting though so you'll find what you want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: debug-gui: add some extra targets for pointer acceleration testing
Peter Hutterer [Tue, 10 Apr 2018 01:05:52 +0000 (11:05 +1000)]
tools: debug-gui: add some extra targets for pointer acceleration testing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "Expose a custom acceleration profile"
Peter Hutterer [Mon, 21 May 2018 02:09:42 +0000 (12:09 +1000)]
Revert "Expose a custom acceleration profile"

This looked good on paper but clearly no-one (including myself) ever tested this
in a real-life situation or they would've noticed that the constant factor is
missing, causing a segfault on the first two-finger scroll event, touchpad
gesture or button scrolling.

Adding the constant factor makes the API much worse and the benefit is
unclear, so out of the window it goes. We can revisit this for libinput 1.12
but this isn't going to make the next release.

This reverts commit d8bd650540e68e8b648e76180c5eee0f19a3b893.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "touchpad: allow custom profiles on touchpads"
Peter Hutterer [Mon, 21 May 2018 02:09:20 +0000 (12:09 +1000)]
Revert "touchpad: allow custom profiles on touchpads"

This reverts commit f6d61dc3147c2df297c117a23752c332abdb1288.

6 years agotest: fix the udev rule for the HP WMI hotkeys device
Peter Hutterer [Fri, 18 May 2018 05:02:55 +0000 (15:02 +1000)]
test: fix the udev rule for the HP WMI hotkeys device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: mark the thinkpad extrabuttons device as ID_INPUT_SWITCH
Peter Hutterer [Fri, 18 May 2018 04:48:15 +0000 (14:48 +1000)]
test: mark the thinkpad extrabuttons device as ID_INPUT_SWITCH

This is supposed to come from systemd on a real setup, but for our test setup
we want to pass the test suite even when the system itself doesn't set it.

6 years agotouchpad: remember the suspend reason
Peter Hutterer [Tue, 15 May 2018 23:40:50 +0000 (09:40 +1000)]
touchpad: remember the suspend reason

There are 4 possible cases why a touchpad suspends right now: lid switch,
tablet mode switch, sendevents disabled and sendevents disabled when an
external mouse is present.

But these reasons can stack up, e.g. a lid switch may happen while send events
is disabled, disabling one should not re-enable the touchpad. This patch adds
a bitmask to remember the reasons we're current suspended, resuming only
happens once all reasons are back to 0.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: split the switch event handlers up
Peter Hutterer [Wed, 16 May 2018 00:03:35 +0000 (10:03 +1000)]
touchpad: split the switch event handlers up

Because we register the handler separately (once for lid, once for
tablet-mode) the handler is called twice for the same event. This causes a
double-suspend of the touchpad, though it doesn't seem to have any real
effect.

Split it up so that each handler function only does one thing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoevdev: add three more Logitech K400-like devices to the debouncing quirk
Peter Hutterer [Thu, 17 May 2018 02:36:03 +0000 (12:36 +1000)]
evdev: add three more Logitech K400-like devices to the debouncing quirk

And rename the model flag, no point in having separate flags here, we likely
have to add more devices over time.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: ptraccel-debug: fail for a sequence without events
Peter Hutterer [Wed, 16 May 2018 06:24:06 +0000 (16:24 +1000)]
tools: ptraccel-debug: fail for a sequence without events

Found by scan-build, running ptraccel-debug --mode=sequence --nevents=5
would use garbage custom_deltas.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: avoid potential integer overflow
Peter Hutterer [Fri, 11 May 2018 05:06:49 +0000 (15:06 +1000)]
util: avoid potential integer overflow

If we need more than 1000 pairs, we have a problem...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: libinput-record: fix leaking memory in the error cases
Peter Hutterer [Fri, 11 May 2018 05:04:22 +0000 (15:04 +1000)]
tools: libinput-record: fix leaking memory in the error cases

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutils: fix leak in kv_double_from_string()
Peter Hutterer [Fri, 11 May 2018 05:02:26 +0000 (15:02 +1000)]
utils: fix leak in kv_double_from_string()

We need to free 'pairs' here, do so by jumping to the error label.

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