Commit graph

2319 commits

Author SHA1 Message Date
Peter Hutterer
1dccc4fdff test: fix some tablet tests' unreached code
These conditions were never triggered by our test suite, so let's tighten up
the tests to match what we expect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
4d20130e05 test: fix pointer accel defaults test
Loop immediately exited, this code was never triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
9483a7a2c0 test: simplify some checks in the path test
The first event is always a device added event, skip the loops that would
paper over this. If we ever change this, the tests *should* fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
a9016f7e15 test: remove some untriggered code from the keyboard tests
The second condition was never triggered because we shouldn't get anything but
keyboard events here. Drain the initial event burst and remove the two
skipping conditions that won't happen anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-17 07:53:49 +10:00
Peter Hutterer
5dcb949c3d Fix doxygen references for natural scroll config
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 16:36:17 +10:00
Peter Hutterer
fd99fcc0db configure.ac: libinput 1.6rc2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 13:08:52 +10:00
Peter Hutterer
572ef99bde udev: fix parse_hwdb.py to work with pyparsing 2.1.10
From systemd commit f644a6da7a: "pyparsing 2.1.10 fixed the handling of
LineStart to really just apply to line starts and not ignore whitespace and
comments any more. Adjust EMPTYLINE to this."

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 12:57:27 +10:00
Peter Hutterer
1019a1703d test: rename wacom test devices to a consistent naming scheme
Use the model names in the file name and append pad/pen/finger as appropriate

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 12:11:19 +10:00
Peter Hutterer
6fb1348765 Revert "Remove the workaround for libevdev pre 1.3"
I'm using semaphore CI for build testing and that only provides Ubuntu 14.04
which doesn't have libevdev 1.3 or later.

Since this is a minor workaround for an error case only, revert the commit
again and leave the handling in. Less effort than having to patch around it in
semaphore.

This reverts commit 1e0736daf3.
2017-01-16 10:24:02 +10:00
Peter Hutterer
0269e3b092 test: remove tablet axis normalization test
gcov analysis showed that none of the actual testing conditions were hit, so
the test succeeded despite not actually testing anything. Which is good,
because testing for tilt normalization isn't correct anyway, tilt is in
physical degrees,

Drop the test and replace it with a test for pressure normalization instead.
We already have a similar one to check for [0, 1] range, this new one
explicitly tests for the extents.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 09:11:41 +10:00
Peter Hutterer
86c2e56132 test: fix a comment regarding uinput's resolution assignment
This isn't true anymore with kernel 4.5 and libevdev 1.5.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:32 +10:00
Peter Hutterer
1e0736daf3 Remove the workaround for libevdev pre 1.3
1.3 has been out since Sep 2014, that's enough time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:32 +10:00
Peter Hutterer
e4a2ce9f03 udev: move check for seat_id down
Don't access the struct until we've verified it is what we want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:32 +10:00
Peter Hutterer
5d66edc9f4 test: prefix all test source files with "test-"
They weren't originally prefixed but the various tests were, but now that we
only have one test runner binary anyway, the prefix helps sorting the files
easily within e.g. gcov results.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:59:00 +10:00
Peter Hutterer
f8c9a2eebb Rename path.(c|h) to path-seat.(c|h)
More consistency with udev-seat.(c|h) and no filename conflict with
test/path.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16 08:58:29 +10:00
Peter Hutterer
f4e47aca33 test: use some helper functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 15:07:24 +10:00
Peter Hutterer
7bb0d62a65 test: fix some empty queue handling
Use the litest_assert_empty_queue() instead of manual checking, and remove the
manual checks after the function call.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 15:06:52 +10:00
Peter Hutterer
ba996a06c5 test: skip a few unnecessary base event conversions
These were just there so we didn't have an unused variable warning, but
there's no reason even assigning to anything in the first place

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 15:06:48 +10:00
Peter Hutterer
a294cf4f90 test: add a synaptics RMI4 test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-12 14:45:50 +10:00
Peter Hutterer
72e01485c0 udev: mark Asus X555LAB as touchpad with visible marker
https://bugs.freedesktop.org/show_bug.cgi?id=99200

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-11 10:39:15 +10:00
Peter Hutterer
43ba2dbb30 touchpad: add a model tag to mark touchpads with visible marker
We used to mark dell touchpads this way but let's make this more generic.
Nothing else used the dell touchpad model flag, so we can simply replace it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-11 10:39:05 +10:00
Peter Hutterer
7b3e583abe Remove a couple of double semicolons
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-11 10:38:52 +10:00
Peter Hutterer
8b1cc20918 configure.ac: libinput 1.6rc1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-10 13:44:15 +10:00
Peter Hutterer
172b45d255 test: swap order for selftest and test suite
Making sure the test suite behaves as expected should be done before we use
it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-10 13:44:15 +10:00
Peter Hutterer
738a39f56b evdev: add helper function to parse a udev flag
Only allow values of 0 and 1 for udev flags. Not that I'm aware of anyone
using anything else (i.e. his shouldn't break anything) but it's best to be as
restrictive as possible here.

Bonus effect: it's now possible to unset LIBINPUT_MODEL_* tags as well,
previously any value (including 0) was counted as "yes".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-04 15:15:27 +10:00
Peter Hutterer
51e35d72ec tools: reduce some spacing to compress the output a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:32:51 +10:00
Peter Hutterer
589e320df6 tools: align device notify output better
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:14:52 +10:00
Peter Hutterer
c92213e24c tools: size in mm is enough, no need for sub-mm precision here
Also changes from W/H to WxH format

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:14:48 +10:00
Peter Hutterer
16bf0deb23 tools: add allowed range to --set-speed help output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 09:35:40 +10:00
Peter Hutterer
91467f7280 test: add test for the vertical position-dependent pinch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-22 07:26:55 +10:00
Peter Hutterer
af1e6c08ac gestures: if fingers don't move, force a gesture by finger position
If the fingers rest on the touchpad without moving for a timeout, switch to
pinch or swipe based on the finger position. We already switched to two-finger
scrolling based on the timeout, now we also do so for 3 and 4 finger gestures.
This gives us better reaction to small movements.

This also fixes previously unreachable code: the test for the finger position
required at least 3 fingers down but was within a condition that ensured only
2 fingers were down. This was introduced in 11917061fe.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-22 07:26:29 +10:00
Peter Hutterer
06489d9b07 tablet: ignore MSC_SCAN
Sent by some HUION tablets

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-21 14:32:45 +10:00
Peter Hutterer
e80873ca6f touchpad: reduce the tap movement threshold to 1.3mm
When a finger moves less than the movement threshold, motion is filtered until
the timeout is hit. If the threshold is too high the responsiveness of the
pointer suffers.

Event analysis from several users showed that 95% of the touches move less
than 1.3mm long. Reducing the threshold should have almost no impact on most
tapping users but improves the reaction time of the pointer for normal
movements.

For a more details see:
http://who-t.blogspot.com/2016/12/libinput-touchpad-tap-analysis.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 13:30:01 +10:00
Peter Hutterer
d0ba1e2b38 touchpad: reduce the initial timeout for tapping after touch
This is the timeout before we decide "this is just a finger down, not a tap".
Until this timeout is hit a finger's movement is filtered. To allow for a more
responsive touchpad, we want that timeout as short as possible.

Event analysis from several users showed that 95% of the touches are less than
100ms long. Reducing the threshold should have almost no impact on most
tapping users but improves the reaction time of the pointer for normal
movements.

For a more details see:
http://who-t.blogspot.com/2016/12/libinput-touchpad-tap-analysis.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 13:30:01 +10:00
Peter Hutterer
acbbe882a2 Merge branch 'touchpad-pointer-accel-revamp' 2016-12-21 11:34:37 +10:00
Peter Hutterer
f4ff619cf7 filter: tweak the magic slowdown
Could be confirmation bias, but it feels better.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
7e5062f632 doc: update the touchpad pointer acceleration svg
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
ff31427e80 filter: revamp the touchpad's acceleration code
The previous code had three main issues:
* acceleration kicked in too early, so even slow movements were accelerated
* acceleration kicked in too quickly, there was only a very narrow window
  where we would have less than the max acceleration factor
* the max accel factor was too low for fast movements, so they still fell
  short of expectations

This patch revamps most of the acceleration though it keeps the basic shape of
the acceleration curve.

* The threshold is increased significantly so that faster movement
  still map to the finger movement. Acceleration doesn't kick in until we get
  to something that's really fast like a flick.
* The incline is dropped, so acceleration kicks in slower than before, i.e.
  the difference between the first speed that is accelerated and the speed
  that reaches the maximum is higher than before.
* The maximum acceleration is increased so ever faster movements get ever
  faster. The max is effectively out of reach now, if you move fast enough to
  hit this speed, your cursor will end up on the moon anyway.

A couple of other changes apply now too, specifically:
* The incline remains the same regardless of the speed
* The max accel factor remains the same regardless of the speed

The caculated factor changes with the speed set so that the base speed changes
with the desired speed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
ec63ecd485 tools: switch the ptraccel-debug printf to use mm/s
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
84ab969c26 filter: work the touchpad magic slowdown into the various parameters
We have everything separate from the mouse now, so having a magic slowdown
isn't needed, we can work this into our parameters. So the acceleration
function now uses everything adjusted, but the factor is still multiplied by
the slowdown in the end.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
4c4b5de641 filter: change touchpad accel code to use mm/s
That's something human brains can map to because mapping a touchpad to
equivalent units of a 1000dpi mouse requires a lot of mental acrobatics. And
I'm getting older and my physio told me acrobatics is more something for the
youngens, possibly those on my lawn listening to terrible music, etc.

The various numbers are converted either times 25.4/1000 or times 1000/25.4,
depending on the usage. Somewhere I made a mistake or a rounding error or
something, so the acceleration curve is not exactly the same, but it's close
enough that it shouldn't matter. The difference shows up in a gnuplot of the
curve but it may not even perceivable anyway. And these values will be
overhauled soon anyway, so meh.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
91d287228f filter: drop the now-generic trackpoint and low-dpi filter functions
The profile is what is still special about those two, the filter itself does
the same as the default filter (calculate velocity, calculate accel factor,
apply to delta).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
bdd4264d61 filter: change the filter functions to take raw device coordinates
We used to normalize all deltas to equivalents of a 1000dpi mouse before
passing it into the acceleration functions. This has a bunch of drawbacks, not
least that we already have to un-normalize back into device units for a few
devices already (trackpoints, tablet, low-dpi mice).

Switch the filter code over to use device units, relying on the dpi set
earlier during filter creation to convert to normalized. To make things easy,
the output of the filter code is still normalized data, i.e. data ready to be
handed to the libinput caller.

No effective functional changes. For touchpads, we still send normalized
coordinates (for now, anyway). For the various filter methods, we either drop
the places where we unnormalized before or we normalize where needed.

Two possible changes: for trackpoints and low-dpi mice we had a max dpi factor
of 1.0 before - now we don't anymore. This was only the case if a low-dpi
mouse had more than 1000dpi (never true) or a trackpoint had a const accel
lower than 1.0 (yeah, whatever).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
187c38f660 Add device_float_get_direction
With some upcoming changes we need this function for device float coordinates
as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:56 +10:00
Peter Hutterer
db9cfc9c5c touchpad: init the device's dpi correctly
This has no real effect just yet because we don't use a touchpad's dpi
anywhere in the touchpad code. Only the acceleration code wants it but all
touchpads use the same acceleration method, and that one doesn't care about
the dpi.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:56 +10:00
Peter Hutterer
8e2d3b9049 filter: duplicate pointer accel for touchpads
This duplicates the code so we can change it for touchpads without affecting
mice.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:56 +10:00
Peter Hutterer
a2dbd4f2d7 filter: drop the dpi_factor in favor of direct calculation
This was badly since the factor was the ratio of "dpi:default dpi"

Most devices don't need it, so storing it in all filters event though we only
use it for some devices is confusing. Now that we have the dpi stored
directlyconfusing. Now that we have the dpi stored directly we might as well
use that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:56 +10:00
Peter Hutterer
f04ef9f985 filter: store the raw dpi value in the filter
Currently unused, will be used in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:56 +10:00
Peter Hutterer
0bd94a17ff touchpad: change direction flags from int to uint32_t
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-21 08:08:59 +10:00
Peter Hutterer
0a82d2fa39 touchpad: if an external touchpad and keyboard share a VID/PID assume dwt
This requires to expand the blacklisting to be a bit more specific so we don't
initialize dwt config on devices that won't need it.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-20 10:21:43 +10:00