Commit graph

3123 commits

Author SHA1 Message Date
Peter Hutterer
fbd284ec14 Merge branch 'wip/touchpad-pointer-accel-v7' 2018-05-21 12:19:17 +10:00
Peter Hutterer
d6e5313497 filter: improve touchpad acceleration
This seems to give me roughly the same behaviour as macos does on the default
0 speed setting.

* Default speed is lower than before by around 30% [1]
* Acceleration kicks in much sooner (130mm/s vs 250mm/s before)
* Acceleration kicks in slower at lower speeds, so the change from 130mm/s to
  150mm/s is less than that of 320mm/s to 350mm/s
* The effect of the speed setting is a wide-range constant (de|ac)celeration
  [2], which means:
  * The unaccelerated baseline up until the threshold now changes with the
    speed setting
  * The threshold is now the same for all speeds
  * The range of the speed setting should now easily cover all desired device
    speeds.
  * Acceleration is steeper at higher speeds
* Deceleration was left as-is.

[1] This may or may not fix the jumping pointer issues caused by the previous
high defaults. When you have high default acceleration you move the finger
slower. This slow movement caused some touchpads (mostly seen on Lenovos) to
create pointer jumps. These weren't seen on synaptics previously because of a
combination of higher user finger speed (thus not triggering the bug) or just
not being as obvious (2px jump vs 10 px jump).

[2] The speed setting is actually a curve, the closer you get to 1.0 the more
difference you see between two different values. The curve's points are:
-1/0, 0/1, 1/5, so the resolution is closer for slow speeds. We still have
double resolution on the setting though so you'll find what you want.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 12:18:58 +10:00
Peter Hutterer
4c31a1a285 tools: debug-gui: add some extra targets for pointer acceleration testing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 12:18:58 +10:00
Peter Hutterer
c94b33768a test: fix the udev rule for the HP WMI hotkeys device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-18 15:26:59 +10:00
Peter Hutterer
187e33f5da test: mark the thinkpad extrabuttons device as ID_INPUT_SWITCH
This is supposed to come from systemd on a real setup, but for our test setup
we want to pass the test suite even when the system itself doesn't set it.
2018-05-18 15:26:57 +10:00
Peter Hutterer
6adb336829 touchpad: remember the suspend reason
There are 4 possible cases why a touchpad suspends right now: lid switch,
tablet mode switch, sendevents disabled and sendevents disabled when an
external mouse is present.

But these reasons can stack up, e.g. a lid switch may happen while send events
is disabled, disabling one should not re-enable the touchpad. This patch adds
a bitmask to remember the reasons we're current suspended, resuming only
happens once all reasons are back to 0.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-18 12:05:02 +10:00
Peter Hutterer
a9d78e99ea touchpad: split the switch event handlers up
Because we register the handler separately (once for lid, once for
tablet-mode) the handler is called twice for the same event. This causes a
double-suspend of the touchpad, though it doesn't seem to have any real
effect.

Split it up so that each handler function only does one thing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-18 12:05:02 +10:00
Peter Hutterer
6dcdfdd513 evdev: add three more Logitech K400-like devices to the debouncing quirk
And rename the model flag, no point in having separate flags here, we likely
have to add more devices over time.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-17 12:37:20 +10:00
Peter Hutterer
3d6ccb57be tools: ptraccel-debug: fail for a sequence without events
Found by scan-build, running ptraccel-debug --mode=sequence --nevents=5
would use garbage custom_deltas.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 16:24:06 +10:00
Peter Hutterer
ba922b59ef util: avoid potential integer overflow
If we need more than 1000 pairs, we have a problem...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 14:23:12 +10:00
Peter Hutterer
7ad3dcf939 tools: libinput-record: fix leaking memory in the error cases
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 14:23:12 +10:00
Peter Hutterer
75e4ab05e4 utils: fix leak in kv_double_from_string()
We need to free 'pairs' here, do so by jumping to the error label.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 14:23:12 +10:00
Peter Hutterer
db2d16bfce tools: ptraccel-debug: switch to a mode enum
Fixes the dead code issue introduced in
822c97a1c2, print_accel was always
true so the rest of the code never got triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 14:23:12 +10:00
Peter Hutterer
8178339b5b meson: add a 'coverity' option to fix the build
Coverity screwed up something so we can't submit builds right now, the
compilation units all fail. math.h pulls in a _Float128 type that coverity
cannot handle. So as a workaround, add an option to the build to avoid this
and remove it when the next version of coverity hopefully fixes this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 14:23:12 +10:00
Peter Hutterer
2d11182689 test: assume Wacom devices are external touchpads
Same as the code itself does.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-16 11:58:14 +10:00
Peter Hutterer
18498fcc49 tools: ptraccel-debug: match the help with the actual trackpoint range value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-15 14:53:51 +10:00
Peter Hutterer
bcd9b4d3ca Update the README and the graphs showing libinput in the stack
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-15 14:18:46 +10:00
Peter Hutterer
3251ba2af0 touchpad: add a tool to measure the touchpad fuzz
Well, I say "measure" but really at this point it just reads the
properties/axes and then does it's best to auto-generate a hwdb entry that
matches the user's hardware and sets a fuzz value on the device. Ideally this
reduces the number of hand-holding required in bugzillas. There are plenty of
things that can go wrong, so our fallback is still to throw up our hands and
point to the documentation.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-15 13:51:33 +10:00
Veli-Jussi Raitila
d7ff5a8f0d 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>
2018-05-15 09:13:29 +10:00
Peter Hutterer
2ca8d6cb08 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>
2018-05-14 11:19:25 +10:00
Peter Hutterer
56721a3ef4 doc: fix typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-14 09:27:39 +10:00
Peter Hutterer
b1efbd41b1 doc: update pointer acceleration doc with the fixed graphs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-11 11:49:39 +10:00
Peter Hutterer
c4a6137876 tools: fix an argument name for ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-11 11:45:53 +10:00
Peter Hutterer
651651f8a8 tools: fix pointer acceleration graphs generation script
We're printing most of those those as mm/s now, improve to use gnuplot for
loops, and a few other fixes. The low-dpi graph is still out of whack (or the
implementation is?), need to fix that separately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-11 11:43:44 +10:00
Peter Hutterer
2a31b21554 gitignore: ignore gnuplot files
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-10 16:25:40 +10:00
Peter Hutterer
f206903823 Fix the scan-build fake leaks
We pass the event to libinput_post_event() where it is appended to the event
queue. Except in these three cases clang doesn't seem to realize what's
happening and complains about memory leaks. I tried workarounds like
g_steal_pointer() but nothing I tried helps. So let's just pretend we're
freeing it when clang looks at us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-10 15:47:37 +10:00
Peter Hutterer
822c97a1c2 tools: switch the ptraccel-debug tool to report profile curves by default
This is virtually the only one that matters at this point, the others may help
but they're usually more confusing than helpful.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-10 15:47:37 +10:00
Friedrich Schöller
af86152370 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>
2018-05-10 14:35:54 +10:00
Paul Kocialkowski
cdebfc78ff udev: Fix Chromebook R13 CB5-312T hwdb name
This fixes a typo in the Chromebook R13 CB5-312T hwdb name match and
extends it to the full model name, so that potential future other
Chromebook R13 devices (that are not CB5-312T) won't use these quirks.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-09 14:18:16 +10:00
Peter Hutterer
a4036a33ca udev: copy the trackpoint sensitivity directly from sysfs
Rather than going the roundabout way of having systemd set the sensitivity
followed by us reading that udev property and hoping, just take the
sensitivity directly from sysfs. This makes us basically independent of what
systemd does (or the lack of systemd, where that is a problem).

It does remove the chance of users to trick libinput by manually adjusting the
sensitivity after the udev rules kicked in, but seriously, we should work on
fixing acceleration properly in that case.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 19:15:18 +10:00
Peter Hutterer
3d81f1179f touchpad: only try to detect touchpad wobbling with one finger down
https://bugs.freedesktop.org/show_bug.cgi?id=106365

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 19:15:00 +10:00
Peter Hutterer
5427d5ed87 Revert "touchpad: only try to detect touchpad wobbling with one finger down"
Logic inversion error from a draft version of the patch, see corrected version
coming up.

This reverts commit 30a398591b.
2018-05-03 19:13:56 +10:00
Peter Hutterer
119b6d924c doc: add two more items I need for trackpoint bugs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 16:08:25 +10:00
Peter Hutterer
0561f68160 doc: drop doc for POINTINGSTICK_CONST_ACCEL, no longer in use
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 15:49:40 +10:00
Peter Hutterer
37e8c56e2c util: remove dead assignment in strv_join
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 15:31:17 +10:00
Peter Hutterer
a1ab4757a4 test: don't use ck_assert_ptr_null
Breaks the build on Ubuntu which ships check 0.10.0 from pre-Dec 2016.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 15:16:33 +10:00
Peter Hutterer
b476345959 tools: libinput-record: print switch events in --with-libinput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 14:03:30 +10:00
Peter Hutterer
8bf2c5ae16 tools: libinput-record: print tablet events in --with-libinput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 13:39:44 +10:00
Peter Hutterer
1e4c5a93a8 util: add a strv_join() helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 12:31:30 +10:00
Peter Hutterer
6fe55cd0ea Allow for TABLET_TOOL_BUTTON events in the various tablet_tool_get_<foo>()
We fill in the events correctly and we already allowed the
get_transformed_x/y functions on a button event, there isn't really a reason
to prohibit these.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 12:28:01 +10:00
Peter Hutterer
d140bb7c2d tools: libinput-record: move the event time offset to the first place we get it
Leftover from a previous version where printing and handling an event was
identical. Now we may handle events but not actually print them until a bit
later, so other events may have a (wrong) zero timestamp.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 12:20:03 +10:00
Peter Hutterer
1392c1f3ac evdev: mask out MSC_TIMESTAMP, we don't need it
Not really an issue at this point, but some HID devices like sending
MSC_TIMESTAMP. Since we don't use them in libinput, all we do is drag
ourselves out of sleep, look at the event, frown because it's not our morning
coffee, and go back to sleep. Instead, disable the code altogether, libevdev
will mask it transparently and then the kernel will let us sleep.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 10:03:28 +10:00
Deepa Dinamani
ee163ef63e Update struct input_event
The struct input_event is not y2038 safe.
Update the struct according to the kernel patch:
https://lkml.org/lkml/2018/1/6/324

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-03 10:03:28 +10:00
Peter Hutterer
30a398591b touchpad: only try to detect touchpad wobbling with one finger down
Too many touches are unreliable with 2+ fingers down and we should error on
the side of not detecting wobbling.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-02 14:17:32 +10:00
Peter Hutterer
9c3a597aab touchpad: reset the wobble detection for non-pointer events
If we get an event other than a motion event we're not wobbling so we need to
reset and restart.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-02 14:17:30 +10:00
Peter Hutterer
be69bcef2c touchpad: reset the wobble detection history for y-only changes
Otherwise we may detect wobble despite having a series of valid y movements,
e.g. the following sequence was detected as wobble:
	x: 1 y: 0
	x: 0 y: 1
	x: 0 y: 2
	x: 0 y: 2
	x: 0 y: 1
	x: -1 y: 0
	x: 1 y: 0

Avoid this by resetting the history when we get a dx == 0 event. It'll take
longer for real wobble to be detected but it reduces the number of false
positives.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-02 14:17:27 +10:00
Peter Hutterer
795657a0a1 tools: print the number of touches for touch devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-02 13:51:00 +10:00
Peter Hutterer
4277d63bc6 Merge branch 'wip/custom-pointer-acceleration-function-v2' 2018-05-02 10:53:08 +10:00
Mike Hogye
a1ca02ec88 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>
2018-05-02 08:20:38 +10:00
Peter Hutterer
63e5372190 Add libinput_device_touch_get_touch_count()
This makes it possible for callers to detect whether a touch device is
single or multitouch (or even check for things like dual-touch vs real
multi-touch) and adjust the interface accordingly.

Note that this is for touch devices only, not touchpads that are just pointer
devices.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-01 09:38:24 +10:00