platform/upstream/libinput.git
5 years agoGitLab CI: Fix clean up stage
Benjamin Tissoires [Mon, 26 Nov 2018 12:01:28 +0000 (13:01 +0100)]
GitLab CI: Fix clean up stage

we need to get the authorization token with the gitlab address, not
the registry.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
5 years agoGitLab CI: use extends to simplify declaration of jobs
Benjamin Tissoires [Mon, 26 Nov 2018 11:09:57 +0000 (12:09 +0100)]
GitLab CI: use extends to simplify declaration of jobs

The build stage gets simpler:
- we define one high level build job
- for each type of distro, we subclass the high-level job with the
  distribution image
- then we subclass the previous jobs into specific release versions
  or specific items to check

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
5 years agoGitLab CI: use buildah/podman instead of docker
Benjamin Tissoires [Fri, 2 Nov 2018 10:44:45 +0000 (11:44 +0100)]
GitLab CI: use buildah/podman instead of docker

well, docker has licensing issues, and the version shipped in
Fedora is getting quite old now.
We have a free open source alternative through buildah/podman/skopeo.

Build our building image in the CI too, so updates can
be achieved by just triggering the bootstrap job.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
5 years agoGitLab CI: replace occurrences of docker by container
Benjamin Tissoires [Mon, 26 Nov 2018 10:49:50 +0000 (11:49 +0100)]
GitLab CI: replace occurrences of docker by container

We want to move away from docker, so let's not reference docker everywhere
when we can use a generic term

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
5 years agoquirks: Adjust MacBookPro11,2 touchpad PalmSize
Thomas Profitt [Tue, 27 Nov 2018 22:14:07 +0000 (16:14 -0600)]
quirks: Adjust MacBookPro11,2 touchpad PalmSize

The touchpad is 104mmx75mm, but an AttrPalmSizeThreshold of 800 is too
  aggressive, and even relatively-small fingers and thumbs register as
  palms sporadically, stopping the mouse until you lift your hand and try again.

1600 was chosen because it's the point at which my fingers and thumbs,
  held at a very low angle, stop registering as palms, so it should
  acommodate bigger fingers.

I don't know if the [Apple Touchpads USB] default of 800 needs to be
  updated too, or if it's a quirk of this particular touchpad.

5 years agodoc/user: bugzilla → gitlab issue
Peter Hutterer [Sun, 25 Nov 2018 22:29:47 +0000 (08:29 +1000)]
doc/user: bugzilla → gitlab issue

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
5 years agoAdded quirk for HP Spectre x360 Convertable 15-bl1xx touchpad.
Arick McNiel-Cho [Fri, 23 Nov 2018 21:10:15 +0000 (15:10 -0600)]
Added quirk for HP Spectre x360 Convertable 15-bl1xx touchpad.

6 years agomeson: increase timeout for the option parsing test
Peter Hutterer [Fri, 9 Nov 2018 00:10:58 +0000 (10:10 +1000)]
meson: increase timeout for the option parsing test

I've had runs with up to 50s, so let's cap it at 2 minutes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: draw evdev events in the debug-gui
Peter Hutterer [Wed, 7 Nov 2018 01:05:05 +0000 (11:05 +1000)]
tools: draw evdev events in the debug-gui

Listen to the pure evdev events from each device and print them. This makes it
slightly easier to associate certain jumps with the output, or otherwise see
that events are coming in even when libinput doesn't seem to process them
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: let debug-events take a device path
Peter Hutterer [Wed, 31 Oct 2018 05:52:25 +0000 (15:52 +1000)]
tools: let debug-events take a device path

This is the most common use-case other than "all from udev", so let's just
parse a device path correctly without requiring --device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: add a test for tool option parsing
Peter Hutterer [Wed, 31 Oct 2018 23:16:03 +0000 (09:16 +1000)]
tools: add a test for tool option parsing

We don't check for correctness in the output as such, just that whatever
combination of cmdline arguments still works/doesn't work. This is the
scaffolding and a few tests, but needs to be filled in, especially for
libinput measure and for some more complex combinations.

valgrind: requires one more python-related suppression
gitlab-ci: requires another environment variable so we know to skip the
   --device tests (udev will time out on those)
meson: skip the test run in release builds, we pass the full path to the built
       libinput tool but rely on the subtool lookup that won't work in a
       release build

Fixes #174

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: make the tools exit with exit code 2 on usage issues
Peter Hutterer [Wed, 31 Oct 2018 23:39:49 +0000 (09:39 +1000)]
tools: make the tools exit with exit code 2 on usage issues

This makes it easier to test for usage issues

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: debug-events: install the signal handler before any libinput operations
Peter Hutterer [Thu, 1 Nov 2018 06:42:27 +0000 (16:42 +1000)]
tools: debug-events: install the signal handler before any libinput operations

On a CI container, we will time out trying to find the udev device for our
device node. This takes 2s, a SIGINT during this time should be treated the
same as one during the mainloop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: handle sigint in debug-gui
Peter Hutterer [Thu, 1 Nov 2018 03:56:16 +0000 (13:56 +1000)]
tools: handle sigint in debug-gui

Exit with success on SIGINT

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agopath: don't leak the udev device on failure
Peter Hutterer [Thu, 1 Nov 2018 06:19:20 +0000 (16:19 +1000)]
path: don't leak the udev device on failure

If by sheer coincidence the device succeeds on the last try, we'd have a
leaking udev device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.12.3 1.12.3
Peter Hutterer [Wed, 7 Nov 2018 03:51:37 +0000 (13:51 +1000)]
libinput 1.12.3

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: allow measuring single-touch ABS_PRESSURE
Peter Hutterer [Tue, 30 Oct 2018 23:55:17 +0000 (09:55 +1000)]
tools: allow measuring single-touch ABS_PRESSURE

Fixes #173

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix a clang warning
Peter Hutterer [Mon, 5 Nov 2018 04:22:46 +0000 (14:22 +1000)]
test: fix a clang warning

test/test-misc.c:1065:28: warning: Value stored to 't' during its
initialization is never read

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: drop a superfluous linebreak in the list-quirks output
Peter Hutterer [Mon, 5 Nov 2018 04:12:00 +0000 (14:12 +1000)]
tools: drop a superfluous linebreak in the list-quirks output

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: handle the EventCodeDisable quirk in the quirks tool
Peter Hutterer [Mon, 5 Nov 2018 03:52:41 +0000 (13:52 +1000)]
tools: handle the EventCodeDisable quirk in the quirks tool

This caused an assertion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoGitlab CI: use the docker:stable image for image creation
Peter Hutterer [Fri, 2 Nov 2018 02:24:55 +0000 (12:24 +1000)]
Gitlab CI: use the docker:stable image for image creation

alpine:latest which is now the default image doesn't docker installed by
default. apk add docker results in failures
Warning: failed to get default registry endpoint from daemon

last time all this worked was when we defaulted to the docker:stable image,
see https://gitlab.freedesktop.org/libinput/libinput/-/jobs/8316

Let's switch back to that and move on with our lives.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agogitlab CI: buildah requires the transport protocol
Peter Hutterer [Fri, 2 Nov 2018 02:03:27 +0000 (12:03 +1000)]
gitlab CI: buildah requires the transport protocol

Executing the script as illustrated sends it to nowhere (localhost maybe?),
prepending docker:// makes it recognize the hostname correctly and actually
upload it to gitlab.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agogitlab CI: swap Fedora 27 for Fedora 29
Peter Hutterer [Fri, 2 Nov 2018 00:20:53 +0000 (10:20 +1000)]
gitlab CI: swap Fedora 27 for Fedora 29

And run all the special stuff we currently run on F28 on F29

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoDon't disable keyboard for Lenovo X230 Tablet in tablet mode
Ryan Walklin [Thu, 1 Nov 2018 17:42:45 +0000 (17:42 +0000)]
Don't disable keyboard for Lenovo X230 Tablet in tablet mode
This also disables the special buttons on the tablet screen. Re-enabling to allow screen rotation.

6 years agoquirks: switch a few model quirks over to use the new evcode disabling
Peter Hutterer [Fri, 19 Oct 2018 05:27:20 +0000 (15:27 +1000)]
quirks: switch a few model quirks over to use the new evcode disabling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add the ability to disable custom event codes/types
Peter Hutterer [Fri, 19 Oct 2018 02:17:03 +0000 (12:17 +1000)]
quirks: add the ability to disable custom event codes/types

This is a more flexible approach than adding a model flag and the C code to
just call libevdev_disable_event_code(). There's a risk users will think this
is is a configuration API but there are some devices out there (e.g. the
Microsoft Sculpt mouse) that need a more generic solution.

Case in point: the Sculpt mouse insists on holding BTN_SIDE down at all times.
We cannot ship any quirks for that device because we only have the receiver's
generic VID/PID. So a local override is required, but we might as well make
that one generic enough to catch other devices too in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoevdev: log the wheel click angle setting
Peter Hutterer [Mon, 29 Oct 2018 03:42:19 +0000 (13:42 +1000)]
evdev: log the wheel click angle setting

Log if we use a non-default click angle setting, makes it easier to debug
this. The condition to add the log was a bit unwieldly to read, so this also
factors out the property names to temporary variables.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.12.2 1.12.2
Peter Hutterer [Wed, 24 Oct 2018 05:23:37 +0000 (15:23 +1000)]
libinput 1.12.2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: move the custom parser test structs into the functions
Peter Hutterer [Fri, 19 Oct 2018 01:25:42 +0000 (11:25 +1000)]
test: move the custom parser test structs into the functions

No need to pollute the namespace here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRemove obsolete HAVE_CONFIG_H check
Peter Hutterer [Tue, 16 Oct 2018 05:37:22 +0000 (15:37 +1000)]
Remove obsolete HAVE_CONFIG_H check

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: disable debouncing on the VMware Virtual mice
Peter Hutterer [Thu, 11 Oct 2018 00:21:54 +0000 (10:21 +1000)]
quirks: disable debouncing on the VMware Virtual mice

At least on MacBooks, the host emulates two clicks 8ms apart in response to a
doubletap. Those clicks are filtered by our debouncing code.

Since these are emulated devices anyway and by definition cannot have a stuck
button, let's tag them so we don't enable the debouncing code. If the button
of the physical device is stuck, that's a problem that needs to be fixed in
the host system.

Fixes #158

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: don't disable keyboard for Lenovo X60 Tablet in tablet mode
Michał Kopeć [Thu, 18 Oct 2018 20:08:28 +0000 (22:08 +0200)]
quirks: don't disable keyboard for Lenovo X60 Tablet in tablet mode

Lenovo X60 tablet has bezel buttons that are bound to the keyboard.
They should not be disabled.

6 years agoquirks: use basename in a POSIX compliant way
Greg V [Sun, 14 Oct 2018 12:15:15 +0000 (15:15 +0300)]
quirks: use basename in a POSIX compliant way

The POSIX version of basename modifies the string (and therefore crashes
on static strings), so use safe_strdup before calling it.

glibc provides a POSIX version when libgen.h is included.
FreeBSD 12 provides a POSIX version when nothing is included, which was
causing a segfault.

Using the POSIX version correctly is the right way to avoid any such issues.

6 years agotest: add tablet-mode suspend/resume keyboard and touchpad tests
Peter Hutterer [Tue, 9 Oct 2018 01:07:02 +0000 (11:07 +1000)]
test: add tablet-mode suspend/resume keyboard and touchpad tests

Related #155

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: handle a touch ending and restarting in the same frame
Peter Hutterer [Mon, 15 Oct 2018 04:45:06 +0000 (14:45 +1000)]
touchpad: handle a touch ending and restarting in the same frame

If a touch ends and starts again in the same frame, our touch count gets out
of whack. This later triggers an assertion when the tap touch count mismatches
the real tap count.

E: 0.105005 0003 0039 -001      # EV_ABS / ABS_MT_TRACKING_ID   -1
E: 0.105005 0003 0035 8447      # EV_ABS / ABS_MT_POSITION_X    8447
E: 0.105005 0003 0036 4479      # EV_ABS / ABS_MT_POSITION_Y    4479
E: 0.105005 0001 014a 0000      # EV_KEY / BTN_TOUCH            0
E: 0.105005 0001 0145 0000      # EV_KEY / BTN_TOOL_FINGER      0
E: 0.105005 0003 0039 0074      # EV_ABS / ABS_MT_TRACKING_ID   74
E: 0.105005 0003 0035 8388      # EV_ABS / ABS_MT_POSITION_X    8388
E: 0.105005 0003 0036 4480      # EV_ABS / ABS_MT_POSITION_Y    4480
E: 0.105005 0001 014a 0001      # EV_KEY / BTN_TOUCH            1
E: 0.105005 0001 0145 0001      # EV_KEY / BTN_TOOL_FINGER      1
E: 0.105005 0003 0000 8388      # EV_ABS / ABS_X                8388
E: 0.105005 0003 0001 4480      # EV_ABS / ABS_Y                4480
E: 0.105005 0000 0000 0000      # ------------ SYN_REPORT (0) ---------- +19ms

This is a kernel bug but let's paper over here because otherwise we crash and
that's considered impolite.

Fixes #161

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: only log the touch state if we have something to log
Peter Hutterer [Mon, 15 Oct 2018 03:47:29 +0000 (13:47 +1000)]
touchpad: only log the touch state if we have something to log

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: fix palm size threshold for the Wacom PTH660
Peter Hutterer [Wed, 10 Oct 2018 06:24:36 +0000 (16:24 +1000)]
quirks: fix palm size threshold for the Wacom PTH660

Copy/paste error in the hwdb to quirks transition

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: suppress tablet-mode for Lenovo X220T keyboard. Resolves #154
Matthias Mayr [Mon, 8 Oct 2018 21:21:36 +0000 (23:21 +0200)]
quirks: suppress tablet-mode for Lenovo X220T keyboard. Resolves #154

The special bezel buttons are associated to the keyboard and would
therefore mistakenly be deactivated as well. See #154.

6 years agotouchpad: avoid motion events when moving one finger into AREA
Peter Hutterer [Wed, 3 Oct 2018 22:34:33 +0000 (08:34 +1000)]
touchpad: avoid motion events when moving one finger into AREA

If a 2fg scroll motion starts with both fingers in the bottom button area and
one finger moves into the main area before the other, we used to send motion
events for that finger. Once the second finger moved into the main area the
scroll was detected correctly but by then the cursor may have moved out of the
intended focus area.

We have two transitions where we may start sending motion events: when we move
out of the bottom area and when the finger moves by more than 5mm within the
button area. In both cases, check for any touches that are in the
bottom area and started at the 'same' time as our moving touch. Mark those as
'moved' to release them for gestures so we get the right finger count and
axis/gesture events instead of just motion events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: don't calculate movement for an already-moved touch
Peter Hutterer [Thu, 4 Oct 2018 00:30:26 +0000 (10:30 +1000)]
touchpad: don't calculate movement for an already-moved touch

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: align the button state log messages
Peter Hutterer [Wed, 3 Oct 2018 22:32:37 +0000 (08:32 +1000)]
touchpad: align the button state log messages

There's one state with a name longer than allocated but it's virtually never
triggered so let's just ignore the misalignment in that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: if two fingers are within the lower thumb area, they're not thumbs
Peter Hutterer [Wed, 3 Oct 2018 04:19:11 +0000 (14:19 +1000)]
touchpad: if two fingers are within the lower thumb area, they're not thumbs

The shape of the average hand implies that two fingers down within the lower
thumb area (the bottom few mm of the touchpad) cannot be thumbs without
significant contortion. So let's not mark them as thumb.

Fixes #126

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.12.1 1.12.1
Peter Hutterer [Wed, 3 Oct 2018 01:41:46 +0000 (11:41 +1000)]
libinput 1.12.1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc/user: add a warning that udevadm test doesn't always work
Peter Hutterer [Wed, 3 Oct 2018 01:11:20 +0000 (11:11 +1000)]
doc/user: add a warning that udevadm test doesn't always work

We rely on the udev keyboard builtin to set the fuzz but that builtin isn't
run during udevadm test. So running sudo udevadm test shows the LIBINPUT_FUZZ
properties the first time round (still set from boot), but not the second time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc/user: fix typo
Peter Hutterer [Wed, 3 Oct 2018 00:55:34 +0000 (10:55 +1000)]
doc/user: fix typo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: ignore motion speed for hovering touches
Peter Hutterer [Tue, 2 Oct 2018 00:40:47 +0000 (10:40 +1000)]
touchpad: ignore motion speed for hovering touches

tp_detect_thumb_while_moving() assumes that of the 2 fingers down, at least
one must be in TOUCH_UPDATE, otherwise we wouldn't have a speed to analyze for
thumb.

If a touch starts in HOVERING and exceeds the speed limit, we were previously
increasing the 'exceeded count'. This later leads to an assert() in
tp_detect_thumb_while_moving() when the second finger comes down because
although we have multiple fingers, none of them are in TOUCH_UPDATE.

This only happens when fingers 2 and 3 come down in the same event frame,
because then we have nfingers_down at 2 (the hovering one doesn't count) but
we don't yet have a finger in TOUCH_UPDATE.

Fix this twofold, first by now calculating the speed on anything but
TOUCH_UPDATE. And second by force-resetting the speed count on
TOUCH_BEGIN/TOUCH_END so we definitely cover all the hover transitions.

Fixes #150

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: fix the trackpoint multiplier for the Dell E7470
Peter Hutterer [Thu, 27 Sep 2018 05:47:23 +0000 (15:47 +1000)]
quirks: fix the trackpoint multiplier for the Dell E7470

Fixes #148

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: fix typo
Peter Hutterer [Fri, 28 Sep 2018 00:38:43 +0000 (10:38 +1000)]
touchpad: fix typo

6 years agofallback: cancel touches, don't just release them when we suspend
Peter Hutterer [Thu, 20 Sep 2018 04:09:31 +0000 (14:09 +1000)]
fallback: cancel touches, don't just release them when we suspend

When we disable the touch device, any existing touches should be cancelled,
not just released.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotablet: make evdev_reject_device return a bool
Peter Hutterer [Thu, 13 Sep 2018 05:16:44 +0000 (15:16 +1000)]
tablet: make evdev_reject_device return a bool

Because that's how we use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: align the rotation value with 3 digits
Peter Hutterer [Fri, 14 Sep 2018 04:27:35 +0000 (14:27 +1000)]
tools: align the rotation value with 3 digits

This is a 0-360 ranged value, so let's print it aligned.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: add a missing space in the proximity in axis listing
Peter Hutterer [Fri, 14 Sep 2018 03:50:55 +0000 (13:50 +1000)]
tools: add a missing space in the proximity in axis listing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoevdev: disable pressure on the Asus UX302LA touchpad
Peter Hutterer [Wed, 19 Sep 2018 23:20:18 +0000 (09:20 +1000)]
evdev: disable pressure on the Asus UX302LA touchpad

This touchpad stops sending pressure data after the first frame of the second
finger down. If the initial pressure is too light, the finger doesn't get
detected even when the pressure increases in the future.

This thing is from 2014, so let's just disable the pressure axes on it
and skip the pressure-based touch detection code. Let's hope that it doesn't
also have ghost touches on light interactions...

Fixes #145

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoevdev: add a quirk for the Kensington Orbit
Peter Hutterer [Mon, 17 Sep 2018 23:27:48 +0000 (09:27 +1000)]
evdev: add a quirk for the Kensington Orbit

Pretends to have a middle button where there is none.

Fixes #142

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: replace the manual enumation of all quirks with a loop
Peter Hutterer [Tue, 18 Sep 2018 00:35:51 +0000 (10:35 +1000)]
quirks: replace the manual enumation of all quirks with a loop

Reduces the places we need to update bits for new quirks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoevdev: switch the model flags to use the quirks directly
Peter Hutterer [Thu, 20 Sep 2018 00:01:49 +0000 (10:01 +1000)]
evdev: switch the model flags to use the quirks directly

Anything that merely requires a once-off check during initialization can just
use the quirks directly, no need to copy them over to the model flags.

Fixes #146

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoevdev: align the model flags for easier reading
Peter Hutterer [Mon, 17 Sep 2018 23:16:43 +0000 (09:16 +1000)]
evdev: align the model flags for easier reading

6 years agoquirks: sort the quirks model flags in alphabetical order
Peter Hutterer [Mon, 17 Sep 2018 23:31:29 +0000 (09:31 +1000)]
quirks: sort the quirks model flags in alphabetical order

6 years agodoc: fix libinput_event_destroy parameter
Diego Rondini [Tue, 18 Sep 2018 12:14:09 +0000 (14:14 +0200)]
doc: fix libinput_event_destroy parameter

Fix libinput_event_destroy call by passing the correct parameter (event) in the
example code.

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
6 years agoAdd issue templates for bugs and feature requests
Peter Hutterer [Tue, 18 Sep 2018 01:54:42 +0000 (11:54 +1000)]
Add issue templates for bugs and feature requests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: extend/restore the Elan Touchpads quirks
Peter Hutterer [Mon, 17 Sep 2018 21:02:27 +0000 (07:02 +1000)]
quirks: extend/restore the Elan Touchpads quirks

The hwdb match entry used to be this one:
 libinput:name:*Elan Touchpad*:dt:*
  LIBINPUT_ATTR_PRESSURE_RANGE=10:8
from commit 596777a3147d4070f9598f051f6d7ae96fa2f49a. It was intended to match
for devicetree only but the way the udev rules were composed, it ended up
matching on any system.

Restore that for all systems to have compatibility with 1.11. For this one,
let's also add the resolution hint and hope that that works too.

Fixes #140

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: fix typos for the Dell XPSL322X touchpad
Peter Hutterer [Mon, 17 Sep 2018 11:04:52 +0000 (21:04 +1000)]
quirks: fix typos for the Dell XPSL322X touchpad

Copy/paste typos introduced in the hwdb to quirks transition

Fixes #141

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: fix the product ID for the MS Nano Transceiver
Peter Hutterer [Mon, 17 Sep 2018 10:49:03 +0000 (20:49 +1000)]
quirks: fix the product ID for the MS Nano Transceiver

Was 0x800 in the hwdb, became 0x8000 in th quirks transition because of
inflation, but let's pretend the economy is back to normal and devalue our
currency. (aka: "it was a typo", whoops and whatnot)

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoFixes incorrect bug reporting documentation
Bennett Hardwick [Mon, 17 Sep 2018 12:51:12 +0000 (22:51 +1000)]
Fixes incorrect bug reporting documentation

6 years agoUpdated: jumping cursor documentation link
Bennett Hardwick [Sun, 16 Sep 2018 08:15:44 +0000 (08:15 +0000)]
Updated: jumping cursor documentation link

6 years agotest: drop a condition from the safe_atou test
Peter Hutterer [Fri, 14 Sep 2018 00:19:55 +0000 (10:19 +1000)]
test: drop a condition from the safe_atou test

If sizeof(long) == sizeof(int), this test won't pass so let's drop it
altogether.

Fixes #137

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: check for < 0 explicitly in safe_atou
Peter Hutterer [Wed, 12 Sep 2018 22:18:16 +0000 (08:18 +1000)]
util: check for < 0 explicitly in safe_atou

The previous check only worked if sizeof(long) > sizeof(int). Rather than be
fancy about it, just cast to a signed long, check for negativity and continue
based on that.

Fixes #137

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: fix a bunch of format conversion complaints
Peter Hutterer [Wed, 12 Sep 2018 03:28:16 +0000 (13:28 +1000)]
tools: fix a bunch of format conversion complaints

Fixes #137

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.12.0 1.12.0
Peter Hutterer [Tue, 11 Sep 2018 03:33:42 +0000 (13:33 +1000)]
libinput 1.12.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: drop the libinput measure trackpoint-range tool
Peter Hutterer [Tue, 11 Sep 2018 01:02:13 +0000 (11:02 +1000)]
tools: drop the libinput measure trackpoint-range tool

This tool is now obsolete, we don't use that range anywhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: tighten the conditions when we call the model quirks
Peter Hutterer [Mon, 10 Sep 2018 05:51:03 +0000 (15:51 +1000)]
udev: tighten the conditions when we call the model quirks

All we do now is to set the fuzz, so we only ever need to care about this when
a device has absolute axes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: re-instate the model-quirks callout
Peter Hutterer [Mon, 10 Sep 2018 05:16:49 +0000 (15:16 +1000)]
udev: re-instate the model-quirks callout

This was removed accidentally as part of a9ef4ba1f33bf8 and then completely dropped in
870ddce9e47a89 when the hwdb was deprecated completely. The model quirks call
is also the one that reads and sets the LIBINPUT_FUZZ property, effectively
making that code a noop.

Fixes #138

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotablet: on tip down/up, force the delta to zero
Peter Hutterer [Thu, 6 Sep 2018 04:11:23 +0000 (14:11 +1000)]
tablet: on tip down/up, force the delta to zero

We may get a pointer jump on tip down/up, see #128. For absolute coordinates
we reset the history to avoid smoothing across that jump but deltas still used
to be calculated based on the previous position to the current one. This
can result in a large jump on tip down.

Since the delta is supposed to be useful (and not physically accurate, see the
docs), let's force it to 0/0 on tip down/up to avoid that scenario.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotablet: always set the changed axis bits if the coordinates differ
Peter Hutterer [Wed, 5 Sep 2018 05:57:02 +0000 (15:57 +1000)]
tablet: always set the changed axis bits if the coordinates differ

Because we're doing axis smoothing, we may get a nonzero delta between events
even when the real axis hasn't updated. Make sure the bit is set in this case.

One part of #128

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: debug-events - print axes on tablet tip events
Peter Hutterer [Wed, 5 Sep 2018 04:33:28 +0000 (14:33 +1000)]
tools: debug-events - print axes on tablet tip events

Bit of a weird diff, print_tablet_axes() was moved up and a single call to
print_tablet_axes() was added in the tablet tip event handler.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc/user: update the trackpoint pointer acceleration graph
Peter Hutterer [Tue, 4 Sep 2018 04:58:18 +0000 (14:58 +1000)]
doc/user: update the trackpoint pointer acceleration graph

Never got updated when the new code was merged

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: style fix, add missing curlies
Peter Hutterer [Fri, 31 Aug 2018 04:52:37 +0000 (14:52 +1000)]
touchpad: style fix, add missing curlies

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: add timestamp-based jump detection
Peter Hutterer [Tue, 21 Aug 2018 05:43:38 +0000 (15:43 +1000)]
touchpad: add timestamp-based jump detection

On Dell i2c touchpads, the controller appears to go to sleep after about 1s of
inactivity on the touchpad. The wakeup takes a while so on the next touch, we
may see a pointer jump, specifially on the third event (i.e. touch down,
event, event+jump). The MSC_TIMESTAMP value carries a hint for what's
happening here, the event sequence for a touchpad with scanout intervals
7300µs is:

...
MSC_TIMESTAMP 0
SYN_REPORT
...
MSC_TIMESTAMP 7300
SYN_REPORT +2ms
...
MSC_TIMESTAMP 123456
SYN_REPORT +7ms
...
MSC_TIMESTAMP 123456+7300
SYN_REPORT +8ms

Note how the SYN_REPORT timestamps don't reflect the MSC_TIMESTAMPS.

This patch adds a quirk activate MSC_TIMESTAMP watching. When we do so, we
monitor for a 0 MSC_TIMESTAMP. Let's assume that the first event after that is
the interval, then check the third event. If that third event's timestamp is too
large rewrite the touches' motion history to reflect the correct timestamps,
i.e. instead of the SYN_REPORT timestamps the motion history now uses
"third-event SYN_REPORT timestamps minus MSC_TIMESTAMP values".

The pointer accel filter code uses absolute timestamps (#123) so we have to
restart the pointer acceleration filter when we detect this jump. This allows
us to reset the 0 time for the filter to the previous event's MSC_TIMESTAMP
time, so that our new large delta has the correct time delta too. This
calculates the acceleration correctly for that window.

The result is that the pointer is still delayed by the wake-up window (not
fixable in libinput) but at least it ends up where it should've.

There are a few side-effects: thumb, gesture, and hysteresis all still use the
unmodified SYN_REPORT time. There is a potential for false detection of either
of these now, but we'll have to fix those as they come up.

Fixes #36

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add a quirk to monitor MSC_TIMESTAMP for pointer jumps
Peter Hutterer [Wed, 22 Aug 2018 04:13:33 +0000 (14:13 +1000)]
quirks: add a quirk to monitor MSC_TIMESTAMP for pointer jumps

Currently enabled on all Dell i2c touchpads, these seem to be the ones that
needed it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: add missing i2c and rmi bus matching
Peter Hutterer [Wed, 22 Aug 2018 04:12:03 +0000 (14:12 +1000)]
quirks: add missing i2c and rmi bus matching

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: make tp_detect_jumps() time-independent
Peter Hutterer [Mon, 27 Aug 2018 02:35:27 +0000 (12:35 +1000)]
touchpad: make tp_detect_jumps() time-independent

This function expected distances per-frame, not per-time which gives us
different behaviors depending on the hardware scanout rate. Fix this by
normalizing to a 12ms frame rate which reflects the touchpad I measured all
the existing thresholds on.

This is a bit of a problem for the test suite which doesn't use proper
intervals and the change to do so is rather invasive. So for now we set the
interval for test devices to whatever the time delta is so we can test the
jumps without having to worry about intervals.

Fixes #121

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc/user: expand the Contributing document
Peter Hutterer [Fri, 10 Aug 2018 05:28:50 +0000 (15:28 +1000)]
doc/user: expand the Contributing document

This is mostly taken from the Weston Contributing.md document.
Main changes from there are:
- more detailed step-by-step on how to create a MR
- commit history/messages in two sections
- s/Weston/libinput/

I skipped the Review/Commit Rights sections for now until there's some demand
for it. Same with the Licensing/Stabilising for releases sections.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Daniel Stone <daniels@collabora.com>
6 years agotools: handle a finger down at startup for measure pressure/touch-size
Peter Hutterer [Wed, 29 Aug 2018 03:55:39 +0000 (13:55 +1000)]
tools: handle a finger down at startup for measure pressure/touch-size

Fixes #117

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: fine tune size-based thumb detection
Matt Mayfield [Wed, 22 Aug 2018 01:54:58 +0000 (20:54 -0500)]
touchpad: fine tune size-based thumb detection

In testing on an Apple Magic Trackpad, thumb touches are reliably
detected by being quite large in the major dimension, but around
half the size in the minor dimension.

6 years agotouchpad: add support for size-based thumb detection
Peter Hutterer [Wed, 25 Jul 2018 04:46:14 +0000 (14:46 +1000)]
touchpad: add support for size-based thumb detection

Fixes #97

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: clean up the thumb pressure handling out a bit
Peter Hutterer [Wed, 25 Jul 2018 04:41:38 +0000 (14:41 +1000)]
touchpad: clean up the thumb pressure handling out a bit

Use a boolean for whether we need to use it and drop the unneded absinfo
assignment (together with the goto).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: abort when we detect a touch jump during the tests
Peter Hutterer [Tue, 28 Aug 2018 00:00:12 +0000 (10:00 +1000)]
test: abort when we detect a touch jump during the tests

We never want to accidentally trigger this one. Where we trigger them on
purpose, we can swap the log handler out first.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: drop the sleep_ms argument
Peter Hutterer [Mon, 27 Aug 2018 23:16:52 +0000 (09:16 +1000)]
test: drop the sleep_ms argument

This forces events for every ~10ms now. If we want a slower movement, we need
more steps - just like a real touchpad does it.

Cocinelle spatch files were variants of:
@@
expression A, B, C, D, E, F, G, H, I, J, K;
@@

- litest_touch_move_two_touches(A, B, C, D, E, F, G, H, I)
+ litest_touch_move_two_touches(A, B, C, D, E, F, G, H)

The only test that needed a real fix was touchpad_no_palm_detect_2fg_scroll,
it used 12ms before, now it's using 10ms so on the bcm5974 touchpad the second
finger was a speed-thumb. Increasing the events and thus slowing down the
pointer means it's a normal finger and the test succeeds again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: force 10ms intervals for touch moves, unless specified otherwise
Peter Hutterer [Mon, 27 Aug 2018 03:22:24 +0000 (13:22 +1000)]
test: force 10ms intervals for touch moves, unless specified otherwise

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: change a few tests to use 10ms intervals
Peter Hutterer [Tue, 28 Aug 2018 00:06:41 +0000 (10:06 +1000)]
test: change a few tests to use 10ms intervals

Change a number of tests to use 10ms intervals between finger events and fix
the coordinates up accordingly to avoid pointer jumps. This is in preparation
for a test-suite wide use of 10ms intervals.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: make the touchpad jump test more robust for timing errors
Peter Hutterer [Mon, 27 Aug 2018 07:00:04 +0000 (17:00 +1000)]
test: make the touchpad jump test more robust for timing errors

move_to() now uses delays, let's make this test more robust for timing errors
so we don't fall below the threshold movement we want to trigger.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: don't run the 2fg pressure tap test on single-touch devices
Peter Hutterer [Tue, 28 Aug 2018 00:45:14 +0000 (10:45 +1000)]
test: don't run the 2fg pressure tap test on single-touch devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix the late tripletap test
Peter Hutterer [Tue, 28 Aug 2018 00:29:51 +0000 (10:29 +1000)]
test: fix the late tripletap test

The coordinates ended up being in the first touch detected as palm. Not
relevant for this test, but let's not do that to avoid false positives.
Also change to 10ms intervals, more realistic given the hardware.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix a touchpad test using the wrong coordinates
Peter Hutterer [Tue, 28 Aug 2018 00:12:44 +0000 (10:12 +1000)]
test: fix a touchpad test using the wrong coordinates

We moved to 60/60 before, not 50/50.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix pad_button_ignored test to not trigger the proximity timeout
Peter Hutterer [Mon, 27 Aug 2018 06:31:12 +0000 (16:31 +1000)]
test: fix pad_button_ignored test to not trigger the proximity timeout

Once we start working with real event frames (i.e. intervals after SYN_REPORT)
we'll always trigger the proximity timeout here. Avoid this by sending one
event with all buttons.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: rename the diagonal scroll test for more clarity
Peter Hutterer [Mon, 27 Aug 2018 05:46:31 +0000 (15:46 +1000)]
test: rename the diagonal scroll test for more clarity

This one only starts with diagonal but continues vertically. Make it clearer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix a DWT test, only worked because of timing success
Peter Hutterer [Mon, 27 Aug 2018 05:19:58 +0000 (15:19 +1000)]
test: fix a DWT test, only worked because of timing success

This test only succeeded because all events were sent within the dwt timeout.
Change it to actually test the behavior of a touch being disabled by DWT and
staying disabled.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: drop two erroneous checks in the dwt tests
Peter Hutterer [Mon, 27 Aug 2018 05:15:37 +0000 (15:15 +1000)]
test: drop two erroneous checks in the dwt tests

These only succeeded because the test suite doesn't use frame intervals - as
soon as the time between event frames is nonzero, we may fail these.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: don't use move_to for a single-step movement
Peter Hutterer [Mon, 27 Aug 2018 04:28:58 +0000 (14:28 +1000)]
test: don't use move_to for a single-step movement

If we only want one event anyway...

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