Commit graph

3464 commits

Author SHA1 Message Date
Peter Hutterer
b9b4065cda 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>
2018-08-27 17:21:45 +10:00
Peter Hutterer
c2877fdb0c 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>
2018-08-27 17:21:45 +10:00
Peter Hutterer
040892572f test: re-use code in litest_touch_move_to()
We can use the _extended version here. And it turns out the behavior was
slightly different, with the _extended version doing one step too few.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-27 17:21:01 +10:00
Peter Hutterer
e640bac867 tools: fix grab handling in libinput debug-gui
The libinput context's user_data was used for deciding whether to grab the
event device but also to hold the struct window data for the debug-gui. Worked
fine for the initial batch of devices, but any device coming in late would
just use the first field of the struct window to decide whether to grab or
not.

Fixes #122

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-27 17:04:51 +10:00
Peter Hutterer
b44f6b4eef fallback: explicitly ignore external keyboards for the tablet mode switch
We already had a check to only pair trackpoints and internal keyboards
but for the ThinkPad Compact Bluetooth Keyboard with TrackPoint that isn't
sufficient - it's an external keyboard that contains a trackpoint. Explicitly
ignore external keyboard, we never want to shut those down in tablet mode
anyway.

Fixes #119

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-27 09:19:46 +10:00
Peter Hutterer
11987b4194 quirks: explicitly mark bluetooth keyboards as external
Required by #119

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-27 09:19:46 +10:00
Kim Lindberger
99334e11bf
Add quirk to control velocity averaging, disable it by default
libinput applies averaging to the velocity of most pointer devices. Averaging
the velocity makes the motion look smooth and may be of benefit to bad input
devices. For good devices, however, it comes at the unfortunate price of
decreased accuaracy.

This change turns velocity averaging off by default (sets ntrackers to 2 instead
of 16) and allows for it to be turned back on via a quirk, for bad devices which
require it.
2018-08-22 12:12:55 +02:00
Kim Lindberger
f82eeae299
tools: fix ptraccel-debug tool for the new trackpoint multiplier
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-22 11:18:05 +02:00
Peter Hutterer
621e224d9a gitlab CI: increase the artifacts expiry to 6h
20 min for the "this docker image is ok" marker should be enough but not when
we're hit with random stuck containers in the next stage. By the time those
time out the artefacts have been removed and we now get a dependency error,
forcing us to re-run the whole pipeline.

Since the marker is only a few bytes, we can keep this for a bit longer
without risking running out of space.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-22 07:35:12 +10:00
Carlos Garnacho
a52f0db3c5 quirks: Add quirks for Acer Switch Alpha 12
This is a 2-in-1 laptop with detachable keyboard. The AT keyboard
device is used for tablet-integrated keys (volume, leftmeta) and
should not get disabled with tablet-mode enabled.

The touchpad integrated in the detachable keyboard is already
handled through the "Acer Hawaii Keyboard" chicony rule.

Related: https://gitlab.freedesktop.org/libinput/libinput/issues/115

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
2018-08-21 13:10:01 +02:00
Atri Bhattacharya
8371a0d74b Lenovo MIIX 720 quirk: MatchBus should be usb.
Fixes commit 0d62c8fb.
2018-08-21 03:35:00 +02:00
Atri Bhattacharya
0d62c8fbba Add quirks for Lenovo MIIX 720.
* Lenovo MIIX 720 is a tablet with a detachable keyboard. To keep
  the volume rockers on the tablet enabled even when the keyboard
  is detached, add `ModelTabletModeNoSuspend=1` to the internal
  keyboard.
* The external keyboard is a keyboard-touchpad combo. Assign
  `AttrTPKComboLayout=below` to the touchpad to allow features
  like disable-while-typing and palm-detection.
2018-08-21 02:45:26 +02:00
Peter Hutterer
db8b6f4e17 quirks: remove the multiplier for the Lenovo UltraNav SK-8845
Looks like this isn't needed, see #112. Or Lenovo re-used USB IDs for this
device in which case we'll have to figure out some other solution once someone
complains.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-20 18:08:31 +10:00
Peter Hutterer
eca2f8c9c6 touchpad: improve pointer jump detection
Previously, we had a hard threshold of 20mm per event frame. That is just
about achievable by really fast movements (in which case you don't care too
much about the jumps anyway because you've already hit the edge of the screen).

Sometimes pointer jumps have lower deltas that are achievable even on slower,
more likely motions. Analysis of finger motion has shown that while a delta
>7mm per event is possible, jumping _by_ 7mm between two events is unlikely
and indicates a pointer jump. So let's diff the most recent delta and the
current delta, if it increases by 7mm between two event frames let's say it's
a pointer jump and discard it.

Helps with but does not fully resolve:
https://gitlab.freedesktop.org/libinput/libinput/issues/80
https://gitlab.freedesktop.org/libinput/libinput/issues/36

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-20 10:23:21 +10:00
Peter Hutterer
02c9c240a2 doc/user: move the tablet capabilities debugging to a separate page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-20 10:06:42 +10:00
Matt Mayfield
18aef32618 doc/user: correct some small typos 2018-08-19 11:54:52 -05:00
Peter Hutterer
c476524a80 doc/user: move the trackpoint multiplier debugging to Troubleshooting
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-16 12:39:15 +10:00
Peter Hutterer
1e61cf6735 doc/user: fix two links for sphinx syntax
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-16 12:28:00 +10:00
Peter Hutterer
7eaf4971aa libinput 1.11.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-14 09:01:46 +10:00
Peter Hutterer
fffae6fb27 test: when testing for a touch sequence, assert it's the same slot's sequence
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-14 08:54:09 +10:00
Peter Hutterer
1668cd5e81 touchpad: drop check for left button areas
No functional changes, anything that's in the top/bottom area but not in the
respective middle/right area is a left button.

Introduced by 13bda5adcb

Fixes coverity complaint about use of uninitialized variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 17:28:40 +10:00
Peter Hutterer
24da4ecd85 touchpad: change the min vector for the scroll lock to 0.15
This makes the difference between noticable delay and unnoticable while having
virtually no false positives (for me).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 14:04:24 +10:00
Peter Hutterer
13bda5adcb touchpad: if a finger in the button area moves by more than 5mm, release it
The software button area is currently a partially-dead area. If the finger
moves into or out of the area pointer motion works. Finger motion within the
area however does not generate motion.

The main motivation for this was to avoid accidental pointer motion when a
button is pressed. This is required for stationary fingers but once you move a
significant distance, those bets are off.

So if the finger moves by more than 5mm from where it was put down, release it
and let it move the pointer.

The full impact is largely limited to horizontal movements within the button
area because:
- leaving the finger at the bottom area for 300ms without movement triggers
  the thumb identification, so it won't move anyway.
- moving the finger north is likely to go off the button area before we
  trigger this threshold.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 13:36:40 +10:00
Peter Hutterer
1bd7976b0b touchpad: coding style fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 13:10:00 +10:00
Peter Hutterer
9d06f34763 touchpad: rename 'curr' to 'current'
We can affort the extra 3 bytes storage.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 13:10:00 +10:00
Peter Hutterer
11a5f91bb7 quirks: don't allow single quotes for values
At least not opening single quotes, same as the double quotes we already have.
Add the tests for both.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
41d4ab3d62 tests: more tests for quirks handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
a897fae128 test: add tests for successful/failing parsing of various quirks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
33ac390aa4 test: fix quirks test for invalid bus type matches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
19ea63bf23 util: tighten safe_atod parsing to only parse 'normal' numbers
We don't have a sensible use case where we want hex to double, or INF to
double, or any of that. So check the strings for invalid characters and bail
out early. Invalid characters include 'e' and whitespaces too, we don't need
those.

Small chance of things breaking: if the user-exposed calibration matrix
property was specified using hex numbers this will stop working now. I'll take
that risk.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
c875de4626 util: switch to a check for isnormal for safe_atod
Effectively the same check as before but this should also encompass
FP_SUBNORMAL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
e73f6a3899 util: fail property parsing if the dimensions are 0
There is no use-case for a zero width/height in anything using that property.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:50:21 +10:00
Peter Hutterer
c8e0e94c00 test: replace hand-rolled backtrace function with gstack
Let's use something that specializes in that task and does a better job of it
than whatever we'll come up with. Due to how it's implemented the stacktrace
will always show waitpid() as frame 0 now but we can live with that.

gstack prints to stdout but litest_log() uses stderr, so we cannot just call
system(), we have do do the pipe/fork/exec/waitpid/read dance.
We could use that to filter the #0 frame showing waidpid() from gstack but
meh.

This drops the libunwind and addr2line dependency and replaces it with gstack
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:43:45 +10:00
Peter Hutterer
3a9c8aa77d meson.build: the selftest doesn't need all litest sources
Drops about 70 ninja targets.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:08:32 +10:00
Peter Hutterer
335554a80e test: remove the deviceless test runner, make it a commandline arg instead
No need to rebuild everything with an ifdef, we can just use meson to pass an
argument to the test itself and filter based on that. This drops about 100
ninja targets.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:08:32 +10:00
Peter Hutterer
0d27a3399d test: switch two ints to bools
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-13 11:08:32 +10:00
Peter Hutterer
e41e7afdf7 doc/user: move touchpad jitter to troubleshooting
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-10 20:48:20 +10:00
Peter Hutterer
05751f4b93 Fix doc links to use dashes, not underscores
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-10 20:48:20 +10:00
Peter Hutterer
87c740a63d doc/user: move the jumping cursor page to troubleshooting
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-10 20:48:20 +10:00
Peter Hutterer
f2d1b34808 test: ensure we write something during litest_sendfile
This mostly shuts up coverity about potentially using a negative size to
write.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Peter Hutterer
3b6cb471d3 test: remove an obsolete comment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Peter Hutterer
04ff6d3f04 meson.build: drop the now-unused liblitest
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Peter Hutterer
0a5dc16976 doc: use configure_file()'s @PLAINNAME@ instead of calling install
Instead of calling out to install on every ninja call, use @PLAINNAME@ as
substitution for just copying the file over. This gets around the "no
directory allowed in output file" limitation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Peter Hutterer
37e21cee9c doc/api: drop git-version.dox
No longer needed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Peter Hutterer
97320328e6 meson.build: process the various tools as a single file list
All these tools just copy the input file over, we can do that in a loop

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Peter Hutterer
307f36e038 meson.build: silence meson warning that we should use configure_file's copy
Yes, we should use 'copy'. But that requires 0.47 and that's not an option
right now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Peter Hutterer
997f30e80e meson.build: fix typo in version to compare to
Introduced in e428e5e87a

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-09 10:39:58 +10:00
Matt Mayfield
bb87a3d9e9 touchpad: 90-degree scroll helper
This makes two-finger scrolling in straight lines easier, while still
allowing free/diagonal movement. It works in three stages:

1) Initial movement
   - For the first few millimeters, scroll movements within 30 degrees
     of horizontal or vertical are straightened to 90-degree angles.
   - Scroll movements close to 45 degree diagonals are unchanged.
   - If movement continues very close to straight horizontal or
     vertical, stage 2 begins and the axis lock engages.
   - If movement continues along a diagonal, stage 2 is skipped and
     free scrolling is immediately enabled.
2) Axis lock
   - If the user scrolls fairly closely to straight vertical, no
     horizontal movement will happen at all, and vice versa.
   - It is possible to switch between straight vertical and straight
     horizontal, and the axis lock will automatically change.
   - If deliberate diagonal movement is detected at any point, stage
     3 begins and the axis lock disengages.
3) Free scrolling
   - Scrolling is unconstrained until the fingers are lifted.
2018-08-08 11:36:39 -05:00
Matt Mayfield
916474b09c test: touchpad: add tests for 90 degree scroll (axis lock) 2018-08-08 11:28:30 -05:00
Matt Mayfield
358a22fc68 doc/user: add 90-degree scroll behavior 2018-08-08 00:40:22 -05:00