platform/upstream/libinput.git
6 years agotest: init the quirks once per test suite run
Peter Hutterer [Thu, 24 May 2018 06:52:42 +0000 (16:52 +1000)]
test: init the quirks once per test suite run

So we have them available per litest device and can check in tests for certain
quirks to be present.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: install per-test device quirks files
Peter Hutterer [Thu, 24 May 2018 05:36:22 +0000 (15:36 +1000)]
test: install per-test device quirks files

These will replace the custom udev rules we currently have in place.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: allow for in-line comments
Peter Hutterer [Wed, 30 May 2018 23:42:15 +0000 (09:42 +1000)]
quirks: allow for in-line comments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoquirks: use an empty dmi modalias string for the test suite
Peter Hutterer [Thu, 24 May 2018 23:23:50 +0000 (09:23 +1000)]
quirks: use an empty dmi modalias string for the test suite

We don't want any of the test devices to match the local machine's DMI
modalias. This was a major drawback in the previous test suite, hacking the
dmi modalias string was nontrivial but a wrong string could cause false
positives or negatives.

The quirks system is internal, so rather than having some fancy API we just
hook it off the environment variable that the test suite always sets. Hacky,
but a lot easier than the other options.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoImplement a quirks system to replace the udev property parsing
Peter Hutterer [Mon, 21 May 2018 04:28:53 +0000 (14:28 +1000)]
Implement a quirks system to replace the udev property parsing

Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.

This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.

The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.

Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.

THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a safe_atou() as unsigned equivalent to safe_atoi()
Peter Hutterer [Fri, 1 Jun 2018 00:21:18 +0000 (10:21 +1000)]
util: add a safe_atou() as unsigned equivalent to safe_atoi()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a list_append()
Peter Hutterer [Wed, 23 May 2018 05:21:56 +0000 (15:21 +1000)]
util: add a list_append()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: remove created directories too
Peter Hutterer [Thu, 24 May 2018 04:49:22 +0000 (14:49 +1000)]
test: remove created directories too

If we created it, remove it again. No change because we're not adding any of
the directories yet.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: make litest_copy_file copy normal files too
Peter Hutterer [Thu, 24 May 2018 04:47:30 +0000 (14:47 +1000)]
test: make litest_copy_file copy normal files too

Make the tempfile creation dependent on whether the required template is
present. Currently unused, this is just prep work for future patches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: remove duplicate Chromebook Falco hwdb entry
Peter Hutterer [Wed, 30 May 2018 05:23:21 +0000 (15:23 +1000)]
udev: remove duplicate Chromebook Falco hwdb entry

We can expand the first one and re-use it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoCOPYING: change a cgit to a gitlab URL
Peter Hutterer [Wed, 6 Jun 2018 01:17:54 +0000 (11:17 +1000)]
COPYING: change a cgit to a gitlab URL

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: drop the publish-doc tool
Peter Hutterer [Wed, 6 Jun 2018 01:15:38 +0000 (11:15 +1000)]
tools: drop the publish-doc tool

libinput docs must be pushed to wayland's web git repository now

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: Fix URLs for GitLab, HTTPS
Daniel Stone [Tue, 5 Jun 2018 10:07:16 +0000 (11:07 +0100)]
doc: Fix URLs for GitLab, HTTPS

The GitLab migrations means that bugs should now be reported there
rather than Bugzilla. Though the repository is still available via
anongit, cloning through GitLab allows use of HTTPS.

All freedesktop.org URLs are also preferentially served over HTTPS
rather than unsecured HTTP.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agofilter: cap trackpoint scale factor at 1.0
Peter Hutterer [Mon, 4 Jun 2018 03:36:08 +0000 (13:36 +1000)]
filter: cap trackpoint scale factor at 1.0

Otherwise we scale up lower-resolution trackpoints' movements, resulting in a
jumpy cursor.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: the IBM X41 Tablet must not disable the keyboard in tablet mode
Peter Hutterer [Sun, 3 Jun 2018 22:16:48 +0000 (08:16 +1000)]
udev: the IBM X41 Tablet must not disable the keyboard in tablet mode

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.11.0 1.11.0
Peter Hutterer [Mon, 4 Jun 2018 00:16:55 +0000 (10:16 +1000)]
libinput 1.11.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: point at --verbose for libinput debug-events
Peter Hutterer [Sun, 3 Jun 2018 23:21:20 +0000 (09:21 +1000)]
doc: point at --verbose for libinput debug-events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: improve the 'tools' page
Peter Hutterer [Sun, 3 Jun 2018 23:20:15 +0000 (09:20 +1000)]
doc: improve the 'tools' page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "udev: copy the trackpoint sensitivity directly from sysfs"
Peter Hutterer [Fri, 1 Jun 2018 01:19:49 +0000 (11:19 +1000)]
Revert "udev: copy the trackpoint sensitivity directly from sysfs"

The lenovo compact keyboard with trackpoint has a sensitivity of 5, which
causes the trackpoint range to be 0. This in turn causes inf/NaN during
pointer acceleration as we divide by 0 and makes the cursor go unpredictably
somewhere it probably shouldn't be.

This is part of a wider problem in that the current sensitivity handling
doesn't work well for values well below the default of 128. Any such values
are scaled up to multiples of pixels instead of just working as-is.

Reverting the automatic sensitivity parsing, any systemd udev property set to
change the sensitivity increases it, so we don't run into this bug.

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

This reverts commit a4036a33ca6ca8da7d2417cac6b840a89b295e5f.

6 years agoevdev: don't allow a trackpoint range of 0
Peter Hutterer [Fri, 1 Jun 2018 02:47:42 +0000 (12:47 +1000)]
evdev: don't allow a trackpoint range of 0

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: move the "Users" section to the top of the "pages" section
Peter Hutterer [Fri, 1 Jun 2018 03:16:08 +0000 (13:16 +1000)]
doc: move the "Users" section to the top of the "pages" section

On the off-chance that someone actually looks at this page, let's put the
comment most at risk by a TLDR attention span at the top.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: drop the JUMPING_SEMI_MT quirk, no-one uses it
Peter Hutterer [Wed, 30 May 2018 01:14:52 +0000 (11:14 +1000)]
udev: drop the JUMPING_SEMI_MT quirk, no-one uses it

Obsolete since 342bc510164e89d7c9a742406fb98f9deabf5c8f when we disabled MT on
all semi-mt touchpads.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: drop the custom firmware detection code in favor of a modalias
Peter Hutterer [Wed, 30 May 2018 00:50:05 +0000 (10:50 +1000)]
udev: drop the custom firmware detection code in favor of a modalias

This was overengineered. The separation between the model quirks file and the
udev hwdb matches allowed for more complex firmware detection. Except we never
used it anywhere but on ALPS and there we can, thankfully, just get it from
the version number in the input_id field exposed in the modalias.

So let's drop this and use that match instead. We just need an extra udev rule
to match on ID_INPUT_POINTINGSTICKs so we can differ between ALPS touchpads
and ALPS trackpoints.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.10.902 1.10.902
Peter Hutterer [Mon, 28 May 2018 23:15:10 +0000 (09:15 +1000)]
libinput 1.10.902

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: replace the hardcoded thumb threshold with a udev prop
Peter Hutterer [Wed, 23 May 2018 23:52:17 +0000 (09:52 +1000)]
touchpad: replace the hardcoded thumb threshold with a udev prop

LIBINPUT_ATTR_THUMB_PRESSURE_THRESHOLD now determines whether we do thumb
pressure detection or not. Much better than having a hardcoded default that
may or may not be correct on any given device.

This patch is likely to break thumb detection on some touchpads, the only
property so far is to restore the default of 100 for all Lenovo Thinkpad
touchpads. More rules are needed, we'll just wait until someone shouts.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRestore the old trackpoint pointer accel picture
Peter Hutterer [Mon, 28 May 2018 03:54:27 +0000 (13:54 +1000)]
Restore the old trackpoint pointer accel picture

Accidentally updated the wrong picture. This reverts part of commit
d6e531349745ff38ae457169d5089ea61297accf.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: update the touchpad pointer acceleration graphs
Peter Hutterer [Mon, 28 May 2018 03:52:10 +0000 (13:52 +1000)]
doc: update the touchpad pointer acceleration graphs

Part of d6e531349745ff38ae457169d5089ea61297accf but I updated the wrong svg
in that commit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: make the dwt paired keyboard list a struct list
Peter Hutterer [Mon, 28 May 2018 01:46:59 +0000 (11:46 +1000)]
touchpad: make the dwt paired keyboard list a struct list

This removes the artificial 3 keyboard limit. If you have more internal
keyboards than that, something is wrong in your setup but that shouldn't stop
us from working. Or more specificially: this can happen easily when running
tests so let's not fail the test suite because we created a few hundred
keyboards.

We'll still throw out a log message though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agofallback: make the paired keyboard list a struct list
Peter Hutterer [Mon, 28 May 2018 01:27:06 +0000 (11:27 +1000)]
fallback: make the paired keyboard list a struct list

This removes the artificial 3 keyboard limit. If you have more internal
keyboards than that, something is wrong in your setup but that shouldn't stop
us from working. Or more specificially: this can happen easily when running
tests so let's not fail the test suite because we created a few hundred
keyboards.

We'll still throw out a log message though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotablet: increase the proximity timeout during test runs
Peter Hutterer [Mon, 28 May 2018 00:38:12 +0000 (10:38 +1000)]
tablet: increase the proximity timeout during test runs

This is causing too many false positives and they're not easy to filter out.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: default to a trackpoint range of 160 for the new ALPS trackpoints
Peter Hutterer [Fri, 25 May 2018 06:37:05 +0000 (16:37 +1000)]
udev: default to a trackpoint range of 160 for the new ALPS trackpoints

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: support firmware detection for pointing sticks
Martin Wilck [Tue, 29 May 2018 07:28:09 +0000 (09:28 +0200)]
udev: support firmware detection for pointing sticks

Add support for firmware detection on pointing stick devices. This
is needed for ALPS only at this time.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput-measure-trackpoint-range: minimum delta measurement
Martin Wilck [Wed, 16 May 2018 14:25:12 +0000 (16:25 +0200)]
libinput-measure-trackpoint-range: minimum delta measurement

libinput-measure-trackpoint-range doesn't work well for ALPS
touchsticks that have minimum delta amplitude of ~8. Fix that
by analyzing min and max amplitude (radius) of the measured deltas,
and suggesting a high trackpoint range value if ALPS-typical behavior
is encountered. Also, suggest a different calibration procedure
to the user; rather then just calibrating quick movements, slow, gentle
movements should also be covered.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput-measure-trackpoint-range: fix typo
Martin Wilck [Wed, 16 May 2018 14:19:10 +0000 (16:19 +0200)]
libinput-measure-trackpoint-range: fix typo

Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix udev prop test for apple touchpads
Peter Hutterer [Fri, 25 May 2018 03:17:34 +0000 (13:17 +1000)]
test: fix udev prop test for apple touchpads

Clearly a copy/paste error.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: fix udev rule for the gpio keys test device
Peter Hutterer [Thu, 24 May 2018 02:34:16 +0000 (12:34 +1000)]
test: fix udev rule for the gpio keys test device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoudev: fix entry for Lenovo X280, missing dmi: prefix
Peter Hutterer [Thu, 24 May 2018 01:14:00 +0000 (11:14 +1000)]
udev: fix entry for Lenovo X280, missing dmi: prefix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput 1.10.901 1.10.901
Peter Hutterer [Tue, 22 May 2018 01:13:27 +0000 (11:13 +1000)]
libinput 1.10.901

6 years agoBump TRACKPOINT_DEFAULT_MAX_DELTA to 120
Chow Loong Jin [Thu, 17 May 2018 19:11:57 +0000 (03:11 +0800)]
Bump TRACKPOINT_DEFAULT_MAX_DELTA to 120

This raises the trackpoint speed limit to something more conducive to
long-distance moves.

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

Signed-off-by: Chow Loong Jin <hyperair@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/custom-pointer-accel-revert'
Peter Hutterer [Mon, 21 May 2018 02:19:30 +0000 (12:19 +1000)]
Merge branch 'wip/custom-pointer-accel-revert'

6 years agoMerge branch 'wip/touchpad-pointer-accel-v7'
Peter Hutterer [Mon, 21 May 2018 02:19:17 +0000 (12:19 +1000)]
Merge branch 'wip/touchpad-pointer-accel-v7'

6 years agofilter: improve touchpad acceleration
Peter Hutterer [Mon, 12 Mar 2018 05:24:07 +0000 (15:24 +1000)]
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>
6 years agotools: debug-gui: add some extra targets for pointer acceleration testing
Peter Hutterer [Tue, 10 Apr 2018 01:05:52 +0000 (11:05 +1000)]
tools: debug-gui: add some extra targets for pointer acceleration testing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "Expose a custom acceleration profile"
Peter Hutterer [Mon, 21 May 2018 02:09:42 +0000 (12:09 +1000)]
Revert "Expose a custom acceleration profile"

This looked good on paper but clearly no-one (including myself) ever tested this
in a real-life situation or they would've noticed that the constant factor is
missing, causing a segfault on the first two-finger scroll event, touchpad
gesture or button scrolling.

Adding the constant factor makes the API much worse and the benefit is
unclear, so out of the window it goes. We can revisit this for libinput 1.12
but this isn't going to make the next release.

This reverts commit d8bd650540e68e8b648e76180c5eee0f19a3b893.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoRevert "touchpad: allow custom profiles on touchpads"
Peter Hutterer [Mon, 21 May 2018 02:09:20 +0000 (12:09 +1000)]
Revert "touchpad: allow custom profiles on touchpads"

This reverts commit f6d61dc3147c2df297c117a23752c332abdb1288.

6 years agotest: fix the udev rule for the HP WMI hotkeys device
Peter Hutterer [Fri, 18 May 2018 05:02:55 +0000 (15:02 +1000)]
test: fix the udev rule for the HP WMI hotkeys device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: mark the thinkpad extrabuttons device as ID_INPUT_SWITCH
Peter Hutterer [Fri, 18 May 2018 04:48:15 +0000 (14:48 +1000)]
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.

6 years agotouchpad: remember the suspend reason
Peter Hutterer [Tue, 15 May 2018 23:40:50 +0000 (09:40 +1000)]
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>
6 years agotouchpad: split the switch event handlers up
Peter Hutterer [Wed, 16 May 2018 00:03:35 +0000 (10:03 +1000)]
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>
6 years agoevdev: add three more Logitech K400-like devices to the debouncing quirk
Peter Hutterer [Thu, 17 May 2018 02:36:03 +0000 (12:36 +1000)]
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>
6 years agotools: ptraccel-debug: fail for a sequence without events
Peter Hutterer [Wed, 16 May 2018 06:24:06 +0000 (16:24 +1000)]
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>
6 years agoutil: avoid potential integer overflow
Peter Hutterer [Fri, 11 May 2018 05:06:49 +0000 (15:06 +1000)]
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>
6 years agotools: libinput-record: fix leaking memory in the error cases
Peter Hutterer [Fri, 11 May 2018 05:04:22 +0000 (15:04 +1000)]
tools: libinput-record: fix leaking memory in the error cases

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutils: fix leak in kv_double_from_string()
Peter Hutterer [Fri, 11 May 2018 05:02:26 +0000 (15:02 +1000)]
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>
6 years agotools: ptraccel-debug: switch to a mode enum
Peter Hutterer [Fri, 11 May 2018 05:01:02 +0000 (15:01 +1000)]
tools: ptraccel-debug: switch to a mode enum

Fixes the dead code issue introduced in
822c97a1c209b92fd6c7fbe6cfa02896941a5143, print_accel was always
true so the rest of the code never got triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agomeson: add a 'coverity' option to fix the build
Peter Hutterer [Fri, 11 May 2018 04:09:40 +0000 (14:09 +1000)]
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>
6 years agotest: assume Wacom devices are external touchpads
Peter Hutterer [Wed, 16 May 2018 01:56:12 +0000 (11:56 +1000)]
test: assume Wacom devices are external touchpads

Same as the code itself does.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: ptraccel-debug: match the help with the actual trackpoint range value
Peter Hutterer [Tue, 15 May 2018 04:53:51 +0000 (14:53 +1000)]
tools: ptraccel-debug: match the help with the actual trackpoint range value

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoUpdate the README and the graphs showing libinput in the stack
Peter Hutterer [Tue, 15 May 2018 04:18:46 +0000 (14:18 +1000)]
Update the README and the graphs showing libinput in the stack

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotouchpad: add a tool to measure the touchpad fuzz
Peter Hutterer [Thu, 26 Apr 2018 01:47:54 +0000 (11:47 +1000)]
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>
6 years agoAdd quirk to fix spurious palm detections on MacBook Pro (13-inch, Mid 2009)
Veli-Jussi Raitila [Fri, 11 May 2018 09:26:16 +0000 (12:26 +0300)]
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>
6 years agoevdev: drop the arbitrary trackpoint range maximum
Peter Hutterer [Mon, 14 May 2018 00:11:10 +0000 (10:11 +1000)]
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>
6 years agodoc: fix typo
Peter Hutterer [Fri, 11 May 2018 05:14:27 +0000 (15:14 +1000)]
doc: fix typo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: update pointer acceleration doc with the fixed graphs
Peter Hutterer [Fri, 11 May 2018 01:48:56 +0000 (11:48 +1000)]
doc: update pointer acceleration doc with the fixed graphs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: fix an argument name for ptraccel-debug
Peter Hutterer [Fri, 11 May 2018 01:17:05 +0000 (11:17 +1000)]
tools: fix an argument name for ptraccel-debug

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: fix pointer acceleration graphs generation script
Peter Hutterer [Thu, 10 May 2018 06:25:57 +0000 (16:25 +1000)]
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>
6 years agogitignore: ignore gnuplot files
Peter Hutterer [Thu, 10 May 2018 06:25:40 +0000 (16:25 +1000)]
gitignore: ignore gnuplot files

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoFix the scan-build fake leaks
Peter Hutterer [Wed, 9 May 2018 04:29:52 +0000 (14:29 +1000)]
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>
6 years agotools: switch the ptraccel-debug tool to report profile curves by default
Peter Hutterer [Thu, 10 May 2018 04:49:38 +0000 (14:49 +1000)]
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>
6 years agotouchpad: fix tapping that happens after a moving thumb
Friedrich Schöller [Sat, 5 May 2018 01:49:32 +0000 (03:49 +0200)]
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>
6 years agoudev: Fix Chromebook R13 CB5-312T hwdb name
Paul Kocialkowski [Mon, 7 May 2018 18:46:39 +0000 (20:46 +0200)]
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>
6 years agoudev: copy the trackpoint sensitivity directly from sysfs
Peter Hutterer [Fri, 23 Mar 2018 01:00:46 +0000 (11:00 +1000)]
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>
6 years agotouchpad: only try to detect touchpad wobbling with one finger down
Peter Hutterer [Thu, 3 May 2018 09:14:14 +0000 (19:14 +1000)]
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>
6 years agoRevert "touchpad: only try to detect touchpad wobbling with one finger down"
Peter Hutterer [Tue, 24 Apr 2018 05:57:04 +0000 (15:57 +1000)]
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 30a398591ba2d7b50767fb2f7d55b2caff491cd3.

6 years agodoc: add two more items I need for trackpoint bugs
Peter Hutterer [Thu, 3 May 2018 06:06:35 +0000 (16:06 +1000)]
doc: add two more items I need for trackpoint bugs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agodoc: drop doc for POINTINGSTICK_CONST_ACCEL, no longer in use
Peter Hutterer [Thu, 3 May 2018 05:49:40 +0000 (15:49 +1000)]
doc: drop doc for POINTINGSTICK_CONST_ACCEL, no longer in use

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: remove dead assignment in strv_join
Peter Hutterer [Thu, 3 May 2018 05:31:17 +0000 (15:31 +1000)]
util: remove dead assignment in strv_join

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotest: don't use ck_assert_ptr_null
Peter Hutterer [Thu, 3 May 2018 05:16:33 +0000 (15:16 +1000)]
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>
6 years agotools: libinput-record: print switch events in --with-libinput
Peter Hutterer [Thu, 3 May 2018 03:51:00 +0000 (13:51 +1000)]
tools: libinput-record: print switch events in --with-libinput

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: libinput-record: print tablet events in --with-libinput
Peter Hutterer [Wed, 2 May 2018 00:50:20 +0000 (10:50 +1000)]
tools: libinput-record: print tablet events in --with-libinput

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a strv_join() helper function
Peter Hutterer [Wed, 2 May 2018 00:25:47 +0000 (10:25 +1000)]
util: add a strv_join() helper function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoAllow for TABLET_TOOL_BUTTON events in the various tablet_tool_get_<foo>()
Peter Hutterer [Thu, 3 May 2018 01:47:57 +0000 (11:47 +1000)]
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>
6 years agotools: libinput-record: move the event time offset to the first place we get it
Peter Hutterer [Thu, 3 May 2018 02:18:22 +0000 (12:18 +1000)]
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>
6 years agoevdev: mask out MSC_TIMESTAMP, we don't need it
Peter Hutterer [Wed, 2 May 2018 23:55:51 +0000 (09:55 +1000)]
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>
6 years agoUpdate struct input_event
Deepa Dinamani [Tue, 16 Jan 2018 00:16:37 +0000 (16:16 -0800)]
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>
6 years agotouchpad: only try to detect touchpad wobbling with one finger down
Peter Hutterer [Tue, 24 Apr 2018 05:57:04 +0000 (15:57 +1000)]
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>
6 years agotouchpad: reset the wobble detection for non-pointer events
Peter Hutterer [Tue, 24 Apr 2018 05:35:46 +0000 (15:35 +1000)]
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>
6 years agotouchpad: reset the wobble detection history for y-only changes
Peter Hutterer [Tue, 24 Apr 2018 00:34:21 +0000 (10:34 +1000)]
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>
6 years agotools: print the number of touches for touch devices
Peter Hutterer [Wed, 2 May 2018 03:51:00 +0000 (13:51 +1000)]
tools: print the number of touches for touch devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoMerge branch 'wip/custom-pointer-acceleration-function-v2'
Peter Hutterer [Wed, 2 May 2018 00:53:08 +0000 (10:53 +1000)]
Merge branch 'wip/custom-pointer-acceleration-function-v2'

6 years agoFix spurious palm detections for Logitech Wireless Touchpad
Mike Hogye [Tue, 1 May 2018 15:14:41 +0000 (11:14 -0400)]
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>
6 years agoAdd libinput_device_touch_get_touch_count()
Peter Hutterer [Wed, 31 Jan 2018 06:04:09 +0000 (16:04 +1000)]
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>
6 years agoutil: allow for palm pressure > 255
Peter Hutterer [Mon, 30 Apr 2018 00:40:45 +0000 (10:40 +1000)]
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>
6 years agotouchpad: fix the trackpoint event counter for the T460s
Peter Hutterer [Fri, 27 Apr 2018 04:40:57 +0000 (14:40 +1000)]
touchpad: fix the trackpoint event counter for the T460s

Introduced in 416fa44d80b0f2c53b652ddfa35dd4a156a65c65 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>
6 years agotouchpad: allow custom profiles on touchpads
Peter Hutterer [Wed, 11 Apr 2018 06:02:43 +0000 (16:02 +1000)]
touchpad: allow custom profiles on touchpads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoExpose a custom acceleration profile
Peter Hutterer [Wed, 14 Jun 2017 02:10:51 +0000 (12:10 +1000)]
Expose a custom acceleration profile

This adds a third profile to the available profiles to map device-specific
speed to an acceleration factor, fully defined by the caller.

There has been a consistent call for different acceleration profiles in
libinput, but very little specifics in what actually needs to be changed.
"faster horses" and whatnot (some notable exceptions in e.g. bug 101139).
Attempts to change the actual acceleration function will likely break things
for others.

This approach opens up the profile itself to a user-specific acceleration
curve. A caller can set an acceleration curve by defining a number of points
on that curve to map input speed to an output factor. That factor is applied
to the input delta.

libinput does relatively little besides mapping the deltas to the
device-specific speed, querying the curve for that speed and applying that
factor. The curve is device-specific, the input speed is in device units/ms.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoutil: add a helper function to split a key-value pair string
Peter Hutterer [Wed, 11 Apr 2018 07:51:44 +0000 (17:51 +1000)]
util: add a helper function to split a key-value pair string

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agofilter: always average the velocity of the first two events
Peter Hutterer [Tue, 24 Apr 2018 05:01:39 +0000 (15:01 +1000)]
filter: always average the velocity of the first two events

Don't apply any velocity diff checking on the first two events, always average
them (unless the timeout is hit or the direction changes). This averages out
some of the jumps we get on slow motion.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agotools: fix the script to make ptraccel graphs for meson's builddir
Peter Hutterer [Tue, 24 Apr 2018 03:28:34 +0000 (13:28 +1000)]
tools: fix the script to make ptraccel graphs for meson's builddir

Partial fix only because we can't guess the build dir, but at least it doesn't
complain about the missing script now. And no-one really needs to run this
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agogestures: if two fingers are in definitive pinch position, pinch
Peter Hutterer [Thu, 26 Apr 2018 01:18:58 +0000 (11:18 +1000)]
gestures: if two fingers are in definitive pinch position, pinch

Two fingers on the touchpad, they're 40x40mm apart, that's a pinch. But only
after a timeout because we don't want to start a 2fg gesture if the user puts
down the third/fourth finger within the next few ms.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>