Commit graph

4625 commits

Author SHA1 Message Date
José Expósito
fbe5d35dca touchpad: revert the clickpad detection mechanism
Use the previous heuristics to detect clickpads where a touchpad was
handled as a clickpad when:

 - The property INPUT_PROP_BUTTONPAD is set
 - The property INPUT_PROP_BUTTONPAD is NOT set but the touchpad only
   has BTN_LEFT

Revert a37d6dcc9c:
"touchpad: if we have a right button, let's assume it's not a clickpad"
MR:  https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/614
BUG: https://gitlab.freedesktop.org/libinput/libinput/-/issues/595

Fix #704

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-12-02 12:00:52 +00:00
Joaquin Gonzalez
0bd1560750 quirks: changes touchpad pressure Lenovo Yoga 2 Pro
Adds touchpad pressure configuration for Lenovo Yoga 2 Pro in order to avoid random cursor jumps on finger up.

Signed-off-by: Joaquin Gonzalez <joaquin.gonzalez.uy@gmail.com>
2021-11-29 04:34:06 +00:00
José Expósito
556e4114b8 doc/user: fix broken link to "Observations on trackpoint input data"
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-28 13:49:14 +01:00
Peter Hutterer
aa7da4c0d9 test: add a tablet test for eraser tip down
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-24 06:17:31 +00:00
Peter Hutterer
9f62995eea test: add missing tool event in the aiptek tablet test device
Needed for eraser tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-24 06:17:31 +00:00
Peter Hutterer
878d00b0e9 test: add tip down/up helper functions
Add two helper functions that set/unset BTN_TOUCH together with the
specified axes and switch all tests over.

Devices can override the tip down/up sequence.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-24 06:17:31 +00:00
Alexander Radovich
35c5ef4e30 quirks: add ModelBouncingKeys for A4Tech X-710BK Mouse
Signed-off-by: Alexander Radovich <rexuru17@gmail.com>
2021-11-23 17:15:22 +00:00
Peter Hutterer
8fecb19147 Use bit(foo) instead of (1 << foo)
Translates to the same thing, but the bit() helper is nicer and less
likely to be typoed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-18 10:11:43 +10:00
Peter Hutterer
b5f0536a4f quirks: add a quirk for the Wacom 524c device
Has tilt, doesn't use it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-18 08:32:48 +10:00
Peter Hutterer
69a3ed420f quirks: make a wacom quirk more descriptive
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-18 08:32:48 +10:00
Peter Hutterer
86698c8184 doc/user: add an example udev rule for LIBINPUT_IGNORE_DEVICE
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-16 06:47:48 +00:00
Peter Hutterer
3cb39abe9b doc/user: expand the udev rules for better readability
Split it over multiple lines and use fake cat command to show where that
rule could live.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-16 06:47:48 +00:00
Peter Hutterer
d1f274c781 quirks: add a more generic match for the 5288 Synaptics clickpad
This is a clickpad announcing BTN_RIGHT in different machines, see
issue #674, #689, #629 and MR !701. There are at least 4 machines that
ship with this device that we had to quirk independently, possibly
others so disabling BTN_RIGHT on all of them makes sense.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-10 22:19:48 +00:00
Gary Wolfe
607abecfbd quirks: Dell 15R touchpad settings for firmware v3
Trackpad sensitivity adjustment only needed for v3 for Dell Inspiron 15R N5110.
Fixes #565 and #676.

Signed-off-by: Gary Wolfe <avidgamefan@yahoo.com>
2021-11-09 05:29:06 +00:00
José Expósito
beea00bc7a gestures: rename event handlers
Follow the name convention used in evdev-wheel.c and rename the handle
event functions from "tp_gesture_[STATE]_handle_event" to
"tp_gesture_handle_event_on_state_[STATE]".

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-09 04:58:07 +00:00
José Expósito
d21f1ab7ab wheel: accumulate scroll when direction changes
Most mice with high-resolution support have a mechanism in place to
adjust the wheel to a detent. When scrolling, it is possible to stop
between two detents and this mechanism could generate a small amount of
scroll in the oposite direction.

Track the scroll direction in the wheel state machine and reset it when
the direction changes to avoid this issue.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-08 18:00:46 +01:00
José Expósito
b6a944bb80 wheel: ignore initial small scroll deltas
Mice with high-resolution support can generate deltas when the finger is
put on the wheel or when the user tries to click the wheel.

To avoid sending involuntary scroll events, add an extra state the the
wheel state machine to accumulate scroll deltas.
While the accumulated scroll is lower than a certain threshold, ignore
them until the threshold is reached.

Since no finish event is sent by the mouse, reset the state machine
after a period of scroll inactivity.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-08 18:00:46 +01:00
José Expósito
08245c778a wheel: handle with a state machine
In order to be able to add more complex rules in the future, transform
the current wheel handling code into a state machine.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-08 18:00:46 +01:00
José Expósito
5f0d191eba wheel: refactor wheel scroll flushing
Move the logic to flush wheel scroll to it's own funtion.
Refactor, no functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-08 18:00:46 +01:00
José Expósito
4e52f03580 wheel: centralize wheel handling
Move the logic to handle wheels to its own file.
Refactor, no functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-08 18:00:34 +01:00
José Expósito
5e44861e0e gestures: cancel hold gestures on thumb detection
Before hold gestures where implemented, when a thumb was detected it
was enough to reset the state machine.
However, now it is possible to detect a thumb while a hold gesture is
in course.

Cancel any ongoing gesture when a thumb is detected to avoid dropping
the gesture end event.

See #693

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-04 18:40:54 +01:00
José Expósito
be3c09bc15 doc/user: fix broken link to systemd 60-evdev.hwdb
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-10-30 12:10:10 +02:00
Peter Hutterer
ac385e12dc libinput 1.19.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-10-21 14:19:49 +10:00
A-w-x
74fac6d040 quirks: add quirk for GPD Win Max
clickpad that announces BTN_RIGHT

Signed-off-by: A-w-x <awxkrnl@gmail.com>
2021-10-20 16:18:33 +02:00
Peter Hutterer
e2d4e0552a test: use a plain libinput context for the log priority check
Don't use the litest wrapper context here, it changes log priority if
the test suite is run with --verbose, causing the test to fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-10-19 13:05:00 +10:00
Travis Wrightsman
9b77661e02 quirks: relax DMI modalias match for Purism Librem 14v1
Both "svnPurism:pnLibrem14:" and "svnPurism:pnlibrem_14:" are possible

Signed-off-by: Travis Wrightsman <travis@wrightsman.org>
2021-10-11 19:23:20 -04:00
Eduardo de Souza Cruz
f5c20fe6b3 evdev: avoid usage of bogus BTN_FORWARD name
Signed-off-by: Eduardo Cruz <eduardo.cruz@kdemail.net>
2021-10-11 17:43:26 -03:00
Sean Rhodes
f2d110dfc5 quirks: Update dmi for StarBook Mk V
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2021-10-11 07:19:39 +00:00
Eduardo de Souza Cruz
34bab6e15e evdev: disable button scroll timeout for extra mouse buttons
Signed-off-by: Eduardo Cruz <eduardo.cruz@kdemail.net>
2021-10-10 23:32:36 +00:00
José Expósito
cf929e9835 gestures: avoid processing the last hold and motion event twice
During the transition from GESTURE_STATE_HOLD_AND_MOTION to
GESTURE_STATE_POINTER_MOTION the last pointer motion event was
processed twice.

Fix #680

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-10-07 08:34:43 +02:00
Sean Rhodes
89cd0f990e quirks: Add quirk for StarLabs clickpads with two phyisical buttons
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2021-10-04 10:19:52 +01:00
Peter Hutterer
b3e5846410 libinput 1.19.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-28 08:46:37 +10:00
José Expósito
5bda716ebf fallback: hires scroll heuristics for buggy devices
Some devices might announce support for high-resolution scroll wheel
by enabling REL_WHEEL_HI_RES and/or REL_HWHEEL_HI_RES but never send
a high-resolution scroll event.

When the first low-resolution scroll event is received without any
previous high-resolution event, print a kernel bug warning and start
emulating high-resolution scroll events.

Fix #668

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-27 22:43:22 +00:00
José Expósito
e0aa946e39 test: add kernel bugs to log handler
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-27 22:43:22 +00:00
Peter Hutterer
bad8b73617 quirks: update the Dell N5110 touchpad quirk
Later versions of this same model seem to have a different ALPS touchpad
and don't need the pressure settings. Narrow down this match so we only
apply to the one from the actual bug report in #565.

Fixes #676

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-28 08:13:54 +10:00
Peter Hutterer
bf61ab9bb0 quirks: add quirk for the Prestigio Smartbook 141 C2 touchpad
Fixes #674

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-27 05:56:37 +10:00
José Expósito
f0d3761f73 libinput: add hold to get base event
LIBINPUT_EVENT_GESTURE_HOLD_BEGIN and LIBINPUT_EVENT_GESTURE_HOLD_END
were missing from libinput_event_gesture_get_base_event.

Add them to avoid triggering an erroneous client bug warning.

Fix #671

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-24 19:06:53 +02:00
José Expósito
ceda09e87b evdev: v120 scroll: invert horizontal scrolling quirk
When required, invert horizontal scrolling in evdev_notify_axis_wheel
following the QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING quirk.

Fix #669

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-21 19:21:03 +02:00
Peter Hutterer
b6e8aef4fb touchpad: mark USB touchpads as internal by default
External touchpads using USB are vanishingly few, built-in touchpads
that use USB are comparatively common. So let's default to internal,
for vendors like Logitech and Wacom that only make external touchpads we
have special conditions in place anyway.

Fixes #664

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-21 09:28:18 +10:00
Peter Hutterer
ea7a88d213 touchpad: use the model flags to determine internal vs external
When pairing a trackpoint, use the model flags for the touchpad, don't
use a separate set of conditions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-21 09:28:18 +10:00
José Expósito
5f966dc6c6 doc: guarantee end sequence for continuous scroll
GTK handles LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS as
GDK_SCROLL_SMOOTH, the same event type that is used to handle
LIBINPUT_EVENT_POINTER_SCROLL_FINGER.

Because Mutter and other compositors, like wlroots based compositors,
translate libinput terminating event to axis_stop instead of doing their
own emulation, if libinput stops sending terminating events, it will
cause client bugs.

Since libinput always sends the terminating event for trackpoints and
button scrolling and there are even tests in place to check for them,
update the documentation to guarantee the terminating scroll sequence.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-19 21:32:59 +02:00
Peter Hutterer
77b36de85d touchpad: reduce the jumping cursor warnings to 5 per day
It's been a while since we really could do something about those jumps,
so let's assume most of these are informative and not a bug in libinput.
For that let's not spam the user's journal and ratelimit it to a handful
a day.

Per day because that increases the chance of an error being present in
the recent logs if the user does search for it.

Related #663

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-17 09:03:17 +10:00
Peter Hutterer
6c869071fb touchpad: fix leak when the touchpad is removed before the dwt keyboard
If a touchpad is removed before its dwt-paired keyboard, we're leaking
the keyboard struct. Fix this by cleaning up properly when our device is
removed.

This is the cause of many failed tests in the udev backend tests during
the CI valgrind run. Because we're testing the udev backend it will add
any devices created by tests run in parallel, some of which are keyboard
devices. Depening on the test completions, the keyboards may or may not
get removed before this device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-15 09:03:21 +10:00
Peter Hutterer
ca0c2470d7 libinput 1.19.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-09-14 17:52:56 +10:00
José Expósito
c9483a6a82 quirks: no button debouncing on generic emulated mouse
When the kernel doesn't support a touchpad, the device is handled as a
generic mouse named "ImPS/2 Generic Wheel Mouse".
Taps are handled as button clicks and the button debouncing code makes
it difficult to double click.

Add a quirk to disable button debouncing for this devices.

Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/656

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-12 21:51:53 +00:00
José Expósito
dbcb003c5e util: add a function to parse bool properties
Move the logic used to parse boolean quirks and udev flags to a common
function in utils.

Refactor, no functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-12 21:16:32 +00:00
weizhixiang
d808817614 use ARRAY_FOR_EACH when traverse array
Signed-off-by: weizhixiang <weizhixiang@uniontech.com>
2021-09-12 15:58:16 +00:00
José Expósito
e4f9c6185b quirks: Microsoft Surface Pro 3 Cover
Mark the Microsoft Surface Pro 3 Cover keyboard as internal.

Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/655

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-06 18:51:01 +02:00
José Expósito
1d6c38782f doc: add missing literal blocks in contributing
Add missing literal blocks in the section "Failed pipeline errors"
introduced in 140b4b7853.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-06 08:42:28 +02:00
Clayton Craft
c053d7b078
quirks: Pine64 PineBook Pro keyboard
The keyboard is 'internal' (built-in), and attached over usb.

Signed-off-by: Clayton Craft <clayton@craftyguy.net>
2021-09-05 14:05:24 -07:00