Commit graph

2959 commits

Author SHA1 Message Date
Peter Hutterer
96e3c5009e libinput 1.10.7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-17 12:08:20 +10:00
Veli-Jussi Raitila
4f0ef58cf8 Add quirk to fix spurious palm detections on MacBook Pro (13-inch, Mid 2009)
https://bugzilla.redhat.com/show_bug.cgi?id=1575260
https://bugs.freedesktop.org/show_bug.cgi?id=106489

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d7ff5a8f0d)
2018-05-17 09:56:41 +10:00
Peter Hutterer
a3b3e85c0e evdev: drop the arbitrary trackpoint range maximum
ALPS SS5 devices have a range above 100.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 2ca8d6cb08)
2018-05-17 09:56:35 +10:00
Friedrich Schöller
a915311180 touchpad: fix tapping that happens after a moving thumb
When finger movement exceeded the motion threshold before the finger was
recognized as a thumb, it would never be regarded as a thumb by the tap system.
This prohibited tapping until the thumb was lifted.

This is fixed by moving the check for the thumb state up such that it
happens before the motion threshold check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit af86152370)
2018-05-17 09:56:24 +10:00
Peter Hutterer
d5b79f70a3 doc: add two more items I need for trackpoint bugs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 119b6d924c)
2018-05-17 09:56:08 +10:00
Peter Hutterer
803db907ec doc: drop doc for POINTINGSTICK_CONST_ACCEL, no longer in use
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0561f68160)
2018-05-17 09:56:01 +10:00
Mike Hogye
71a3f31bb1 Fix spurious palm detections for Logitech Wireless Touchpad
This device frequently reports large pressure values during normal usage.
It does not require a tight palm threshold, because it is a desktop device
-- not built into a laptop surface -- so we can avoid false positives by
setting a very high threshold.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a1ca02ec88)
2018-05-17 09:54:51 +10:00
Peter Hutterer
6618a79568 util: allow for palm pressure > 255
https://bugs.freedesktop.org/show_bug.cgi?id=105753

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 59eb10e593)
2018-05-17 09:54:46 +10:00
Peter Hutterer
4e0ece4a5e touchpad: fix the trackpoint event counter for the T460s
Introduced in 416fa44d80 but there was a logic
error: we claimed to require 3 events from a trackpoint before stopping the
touchpad but the timer was only set when we actually stopped the touchpad. So
if a trackpoint sends a single event every second, we'd disable the touchpad
after 3 seconds for the duration of the timeout, then again 3 seconds later,
etc.

Fix this by always setting the timeout and resetting the event counter if no
activity happened.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c0fd857def)
2018-05-17 09:54:42 +10:00
Peter Hutterer
77beef4735 libinput 1.10.6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-01 17:23:36 +10:00
Peter Hutterer
5b2c7a3b40 evdev: disable ABS_MT_TOOL_PALM on the Lenovo X1 Carbon 6th gen
This device randomly decides that a touch is now a palm, based on
the moon phase, the user's starsign and possibly what the dog had for
breakfast. Since libinput assumes that a touchpad that labels a touch as palm
has reasons to do so, let's unassume this for this device by disabling that
axis altogether and relying on the touch pressure only.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 74e20e0ae0)
2018-04-27 15:13:26 +10:00
Davide Depau
831e1664d6 evdev: don't suspend keyboard on ThinkPad X1 Yoga 1st in tablet mode
When the X1 Yoga is in tablet mode, one capacitative touch button (windows
key, sends KEY_LEFTMETA) and two side volume buttons are accessible on the
front. The key event comes through the internal keyboard that we disabled in
tablet mode so it stops working.

Luckily the Yoga physically disables the "main" keyboard when in tablet mode,
so all we have to do is skip our code to disable the keyboard and the keys are
working again.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5feaa5f00c)
2018-04-27 15:12:30 +10:00
Peter Hutterer
4dcba5d889 udev: add the P50 to the T450 jumping motion quirks
On slow finger motion, this device also sends a bunch of events with only
pressure updates, followed by a massive coordinate jump. Enable the quirk so
we skip that jump.

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

This patch was initially applied as ab55302ef and reverted as e8cb7e4523.
Turns out the issues are unrelated to this patch, so let's re-apply it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0dccaa8a42)
2018-04-27 15:11:45 +10:00
Daniel van Vugt
0a6d0531fc Improve responsiveness for Apple Magic Trackpad
The touch size threshold was too high, so occasionally libinput would
think the finger had lifted when it hadn't and events would be ignored.

Similarly, the palm threshold was too low, so occasionally libinput would
think a heavy single finger was a palm and ignored that too.

This fixes both of those issues.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d5b4558675)
2018-04-27 15:11:36 +10:00
Peter Hutterer
7c95300758 libinput 1.10.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-19 11:41:08 +10:00
Peter Hutterer
d16cbccee6 udev: add T450s trackpoint range
From https://bugs.freedesktop.org/show_bug.cgi?id=103947

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 93dfd0fa54)
2018-04-18 15:10:47 +10:00
Peter Hutterer
0ef5e3f167 udev: add trackpoint range for the T440s
Measured at 200 sensitivity because that's what systemd sets for us

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit cf445f99dc)
2018-04-18 15:10:41 +10:00
Peter Hutterer
a391e89041 evdev: point users to the trackpoint documentation for missing ranges
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f2b1eed976)
2018-04-18 15:09:45 +10:00
Peter Hutterer
1ea91b212b udev: add trackpoint range for Lenovo X280
https://bugs.freedesktop.org/show_bug.cgi?id=105485

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9d7f48b66a)
2018-04-18 15:09:41 +10:00
Sean Lanigan
6c7adee8b0 Add Dell XPS13 L322X touchpad quirks
Signed-off-by: Sean Lanigan <sean@lano.id.au>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5aec854ac3)
2018-04-18 14:10:28 +10:00
Peter Hutterer
8b338f0b5f debounce: disable debouncing on the Logitech K400
This is an external keyboard+touchpad but not recognised as touchpad by the
kernel so it's in mouse emulation mode. Double-taps are sent with impossibly
close timestamps and filtered out by the debouncing code. Since this isn't a
real button that can wear out anyway, let's just disable debouncing on this
device.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 23614f7551)
2018-04-13 10:50:56 +10:00
Peter Hutterer
e4f0ee9677 libinput 1.10.4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-09 14:06:15 +10:00
Peter Hutterer
201eaf3a8b touchpad: don't process state for a touch in TOUCH_NONE
If a touch is in TOUCH_NONE, there is nothing to see here, please move along.

In the case of bug 105696, we were accessing the speed.exceeded_count of a
touch that was released previously, erroneously detecting a speed-based thumb.
The sequence was:
- touch down in slot 0, speed.exceeded_count is reset to 0
- move touch until exceeded_count is greater than our threshold
- touch up in slot 0
- touch down in slot 1 [1]
- touch down in slot 2 (more than 25mm away)
- we counted the slot 0 speed.exceeded_count, labeling the slot 2 touch as
  speed-based thumb

[1] peculiar behavior only observed on this device, usually slots get re-used
at the first opportunity so having an inactive slot followed by higher slots
being used is unusual.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 928bad9104)
2018-04-09 13:57:14 +10:00
Peter Hutterer
9585fe86ee Fix a doxygen link for the get_default_matrix call
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 24963d4e45)
2018-04-09 13:57:05 +10:00
Peter Hutterer
bab4ca0274 touchpad: use the fuzz value (if any) for the hysteresis margin
We currently used 0.5mm on touchpads as hysteresis value. This causes pointer
movement delays, it is likely too high. Reduce it to a kernel-set fuzz value
(if any) and see how we go with that. On many touchpads, the fuzz is 8 which
would be closer to 0.2mm on e.g. a T440.

Note that the does some defuzzing anyway, but the response of that function is
nonlinear, e.g. for a fuzz of 8, the physical deltas map to:

phys 0..3  → delta 0
phys 4..7  → delta 1
phys 8..15 → delta 4, 5, 6, 7
phys 16..N → delta 16..N

In other words, we never see some logical deltas 2 and 3. While this shouldn't
matter given the average touchpad resolution, reducing the hysteresis margin
is likely to provide some better response. We never see values 8-15 either
which could be the cause of some pointer jumps we've been seeing.

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

Devices with a fuzz of 0 have the hysteresis margin reduced to 0.25mm (from
0.5mm).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ea7498ef97)
2018-04-09 11:38:08 +10:00
Peter Hutterer
579428cdf4 tools: touchpad-pressure: init the lo/hi values correctly
From https://bugs.freedesktop.org/show_bug.cgi?id=105535

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 4ff5f02d9c)
2018-04-09 11:23:57 +10:00
Peter Hutterer
f36bb869ee touchpad: don't enable top palm detection on touchpads <= 55mm high
Tiny enough as it is, let's not take usable space away.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d786b55daa)
2018-04-09 11:23:38 +10:00
Peter Hutterer
75215aaf5e tools: fix man page for debug-events
click method is 'buttonareas', not just 'buttons'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a59ce1c0c4)
2018-04-09 11:23:24 +10:00
Nandor Han
71191a88c2 udev: validate input devices during cold-plug
During libinput initialization a list of existing input devices is
retrieved from udev. This can lead to a situation where libinput can
end up processing un-configured devices because of the race generated
by udev events and libinput startup.
Sequence example:
weston - start
udev - device 1 added
weston - get a list of input devices
weston - process device 1 -- undefined behavior
udev - device 1 added - finalized

The problem was found because of incorrect touchscreen association
when in a dual monitor system the secondary touchscreen was
incorrectly associated with output one since udev didn't finish the
device initialization and WL_OUTPUT was missing.

To avoid this situation we skip un-configured devices during libinput
initialization, relying on udev to send events when devices are
fully configured.

Note: due to the peculiarities of udev_device_get_is_initialized(), the
input device is still processed if the call fails. If there are no udev
rules defined for the device, it will never be reported as initialized,
but this is not a problem, because all input devices handled by libinput
must have some udev properties set, therefore they always have rules.

Signed-off-by: Nandor Han <nandor.han@ge.com>
[Pekka: change log to debug, unref device]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 23d543b711)
2018-04-09 11:14:03 +10:00
Peter Hutterer
f2cfd8a693 touchpad: only keep low-pressure fingers alive for 2+-slot touchpads
Regression introduced by 3979b9e16a, bug 105258.
With that commit, we only ended real touches when we had less than nslots fake
fingers down. i.e. tripletap on a 2 slot touchpad would not end the
first/second touch even if the pressure goes below the threshold. e.g. Lenovo
x270 needs this, see https://bugs.freedesktop.org/attachment.cgi?id=137672, it
dips below the pressure threshold for the first slot and ends the second slot
in the same frame as the third finger is detected. Fun times.

Anyway, this breaks semi-mt touchpads, another fine category of devices,
because some of those can detect hovering fingers at low pressure, see bug
105535. Because semi-mt devices are generally garbage, we treat them as
single-touch devices instead. So whenever two fingers are down, we treat both
as above the pressure threshold, even when they're physicall hovering.

Fix this by making the x270 fix conditional on at least 2 slots.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3f5ff113a8)
2018-04-03 16:08:02 +10:00
Peter Hutterer
decfb09027 libinput 1.10.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-14 15:18:06 +10:00
Peter Hutterer
204820e4de touchpad: make sure we compare only the last 3 events for wobble
We're left-shifting the bits but weren't comparing against the l_r_l mask
itself. So if we get a sequence of [1, 1, 0, 1] we didn't detect a wobble
because 0b1101 != 0b101 (what we're looking for).

Fix this by turning it into a right shift, that way the bits fall off
the mask automatic
                  al
                    ly
                      y
                      y
                      y
                      y
                     .  .
                   _._v.___

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5883ac7d98)
2018-03-14 10:17:32 +10:00
Peter Hutterer
42e8813a63 touchpad: end hovering touches in maybe_end_touch
Otherwise a hovering touch stays around forever even after the finger has
discontinued. This doesn't matter on slots, but for fake fingers the finger
may suddenly end up being forced down/up as a result of the pressure changes
on the real fingers.

So when in maybe_end_touch, switch them back to NONE immediately - hovering
touches do not need to trigger a TOUCH_END event.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d8db6b5927)
2018-03-12 12:03:28 +10:00
Peter Hutterer
eeb967b650 libinput 1.10.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-07 15:01:49 +10:00
Daniel van Vugt
b437b2f196 Introduce omnidirectional (elliptical) hysteresis
This changes the hysteresis region to an ellipse (usually a circle), where
previously it was a rectangle (usually square).

Using an ellipse means the algorithm is no longer more sensitive in some
directions than others. It is now omnidirectional, which solves a few
problems:
  * Moving a finger in small circles now creates circles, not squares.
  * Moving a finger in a curve no longer snaps the cursor to vertical
    or horizontal lines. The cursor now follows a similar curve to the
    finger.

https://bugs.freedesktop.org/page.cgi?id=splinter.html&bug=105306

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6936a15558)
2018-03-07 10:42:27 +10:00
Peter Hutterer
1c15e162b8 touchpad: add a TOUCH_MAYBE_END state
This state is used by the pre-processing of the touch states to indicate that
the touch point has ended and is changed to TOUCH_END as soon as that
pre-processing is finished.

Sometimes we have to resurrect a touch point that has physically or logically
ended but needs to be kept around to keep the BTN_TOOL_* fake finger count
happy. Particularly on Synaptics touchpads, where a BTN_TOOL_TRIPLETAP can
cause a touch point to end (i.e. 1 touch down + TRIPLETAP) but that touch
restarts in the next sequence. We had a quirk for this in place already, but
if we end the touch and then re-instate it with tp_begin_touch(), we may lose
some information about thumb/palm/etc. states that touch already had. As a
result, the state machines can get confused and a touch that was previously
ignored as thumb suddenly isn't one anymore and triggers assertions.

The specific sequence in bug 10528 is:
* touch T1 down
* touch T2 down, detected as speed-based thumb, tap state machine ignores
  it
* frame F: TRIPLETAP down, touch T2 up
* frame F+1: touch T2 down in next frame, but without the thumb bit
* frame F+n: touch T2 ends, tap state machine gets confused because
  that touch should not trigger a release

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6ccd8e934f)
2018-03-07 10:42:15 +10:00
Peter Hutterer
40750c26f8 touchpad: don't end below-threshold pressure touches if nfake_fingers > nslots
If we have more BTN_TOOL_*TAP fingers down than we have slots, ignore any
below-threshold pressure changes on the slots. When a touchpad only detects
two touches, guessing whether the third touch has sufficient pressure is
unreliable. Instead, always assume that all touches have sufficient pressure
when we exceed the slot number.

Exception: if all real fingers are below the pressure threshold, the fake
fingers are ignored too.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3979b9e16a)
2018-03-07 10:39:54 +10:00
Peter Hutterer
dd85749e61 touchpad: add the pressure thresholds to the debugging output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 85e5d80cd4)
2018-03-07 10:39:53 +10:00
Peter Hutterer
2496923585 test: don't run the 2fg pressure test on single-touch touchpads
Only the appletouch has pressure and thus executed that code path

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 21b83dfd0b)
2018-03-07 10:39:52 +10:00
Peter Hutterer
0fec9c65e9 test: don't run the MT pressure test on devices without MT pressure
This test worked because on devices that don't use pressure the touches were
reset when BTN_TOUCH when to 0, triggering the 'ignore fake fingers when no
real fingers are down' behavior. But this is a different code path than the
pressure handling, so let's separate those tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 990da54aa6)
2018-03-07 10:39:51 +10:00
Mario Di Raimondo
c4fc98731d Fix Apple Magic Trackpad sensitivity
https://bugs.freedesktop.org/show_bug.cgi?id=103572

Signed-off-by: Mario Di Raimondo <mario.diraimondo@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f47eb2d796)
2018-03-07 10:39:48 +10:00
Konstantin Kharlamov
3efd7c82aa touchpad: add wobbling detection
The details are explained in comment in the code. That aside, I shall
mention the check is so light, that it shouldn't influence CPU
performance even a bit, and can blindly be kept always enabled.

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

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
(cherry picked from commit 400aadd53a)
2018-03-02 14:04:08 +10:00
Konstantin Kharlamov
5f4d975861 touchpad: remove the code for disabling hysteresis
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
(cherry picked from commit e8dffbd73a)
2018-03-02 14:04:07 +10:00
Peter Hutterer
298b28d7f1 touchpad: move the hysteresis into its own substruct
Prep work for the wobbling detection patch

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
(cherry picked from commit e43bd4ae3a)
2018-03-02 14:04:06 +10:00
Peter Hutterer
68949fc5c5 touchpad: don't do speed-based thumb detection on single-touch or semi-mts
Because life is too short for this

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 39b806089c)
2018-03-02 14:03:57 +10:00
Peter Hutterer
25d1fbbf00 meson: add the 221 version to the libsystemd dependency
The sd-bus interface we're using wasn't public until 221.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 8353eeb5a8)
2018-03-02 14:03:40 +10:00
Peter Hutterer
5c86ba7580 libinput 1.10.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-02-28 10:03:22 +10:00
Peter Hutterer
c5c6cc13be tools: fix inverse up/down threshold handling in measure touch-size
https://bugs.freedesktop.org/show_bug.cgi?id=105264

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5b29be3998)
2018-02-28 08:48:08 +10:00
Peter Hutterer
70258657b0 tools: fix option parsing in libinput measure
Missing '+' in the optstring caused it to evaluate all options. If any
argument was passed to a subcommand, libinput-measure would throw an error and
exit.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 59550ed21c)
2018-02-28 08:48:03 +10:00
Peter Hutterer
596a03a0fa touchpad: only begin fake touches when we have at least one finger down
If a single-touch touchpad drops below the pressure threshold in the same
frame where a fake finger is added, we begin a fake touch here. The subsequent
loop ends this fake touch because real_fingers_down is 0.

This causes the tapping code to have a mismatch of how many fingers are down
because it never sees the touch begin event for that finger.

https://bugs.freedesktop.org/show_bug.cgi?id=105160
(cherry picked from commit 01a633b6eb)
2018-02-28 08:47:44 +10:00