Commit graph

420 commits

Author SHA1 Message Date
Greg V
f8b412052e Import versionsort implementation from musl for systems without versionsort
versionsort is a GNU extension, not available on *BSD systems.
2018-07-16 13:44:11 +03:00
Peter Hutterer
e6cad92005 Rename data/ to quirks/
A better, less ambiguous name than just "datadir"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-13 13:30:54 +10:00
Peter Hutterer
f4dc296247 quirks: remove the leftovers of the trackpoint range attribute
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:49:02 +10:00
Peter Hutterer
27f7a66de4 filter: add a trackpoint multiplier factor
Measuring the trackpoint range has not shown to be sufficient or precise
enough to be used as an ingredient for trackpoint acceleration. So let's just
switch back to a generic multiplier that we can apply to the input deltas do
undo any device-specific lack of scaling.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
1cc9f44e93 quirks: add quirks_get_double()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
0021f9e7a8 tools: make-ptraccel-graphs: drop an unnecessary outfile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
6480bfe14d tools: drop the special handling for trackpoint accel, not needed anymore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
fc92aaf545 tools: reduce the trackpoint gnuplot range to 0..1 units/ms
Anything above 1 unit/ms is high pressure. Though that depends on the
trackpoint range, so...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
5f9c985661 tools: fix units for trackpoint accel graph
We use speed now and trackpoints are in units/ms

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
6dca5df806 filter: make the trackpoint accel profile func the same prototype as the others
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-11 16:04:59 +10:00
Peter Hutterer
00fdbe3951 tools: don't add the debug behavior for release builds
When the meson build type is something other than the debug types, we don't
need the special behavior where we adjust executable paths and data dir
lookup for tools run directly from the builddir.

This avoids leaking the build dir into the final executables.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 13:27:15 +10:00
Peter Hutterer
6be9c3c84e tools: fake-build the other tools the same way as measure touchpad-tap
Doesn't actually do anything but this way they end up in the builddir and can
be picked up by ./builddir/libinput measure fuzz, etc.

And rename the source files to .py to signal that they are not supposed to be
directly executed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
2caf557e10 tools: rely on the libinput and quirks tool to pick the right directories
Don't use a custom hack here, just make sure the tool ends up in the builddir
so it's picked up by the libinput main tool.

This means the PATH isn't set up correctly when called directly
(./builddir/libinput-measure-touchpad-pressure) but the workaround is to
always use the libinput tool - just as we expect from users.

To make it more obvious that we're not supposed to run this directly, rename
the source file to .py

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
25a6535570 tools: quirks: if we're executing from the builddir, use the git datadir
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
7e7d657dab tools: if the execdir is the builddir, add it to the path
When running libinput tools from the builddir, look up the subtools in the
builddir as well. Otherwise, add the install prefix to the list of lookup
locations.

This ensures that a) we're running builddir stuff against builddir stuff, but
also b) that we're not running builddir stuff against installed stuff because
that may give us false positives.

The test was squashed in from a separate patch and was
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-09 11:28:41 +10:00
Peter Hutterer
e723398c14 tools: rename list-quirks to the more generic "quirks list"
Enables us to easily add more tools where needed and it is
more consistent with the existing tools.

The commands are now:
   libinput quirks list
   libinput quirks validate

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-03 15:16:59 +10:00
Peter Hutterer
4f5182c8b0 tools: add record/replay to --help output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-27 15:40:13 +10:00
Peter Hutterer
ea5edf09c4 tools: libinput-record: print the list of quirks
Now that all device quirks are in the quirks subsystem we have to print those
instead of just the udev devices.

Since libinput-record is there to record system devices, the system-installed
quirk list is used (without any commandline overrides right now). This is
useful to capture misconfigurations or missing quirks on the host system.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 13:59:30 +10:00
Peter Hutterer
07e93f077e tools: move printing device quirks to the shared tools lib
This way we can re-use this from libinput-record instead of having to
duplicate all this. Since the two tools use different printfs, just make the
actual printing a simple callback.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 13:59:30 +10:00
Peter Hutterer
b049d6696d tools: fake-build the measure touch-pressure/size sources
This way we can make them execute the list-quirks from the builddir. And it
makes it easier to run these tools from the git directory on machines where we
have libinput without the quirks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 01:30:25 +00:00
Peter Hutterer
c20d50eb6f tools: libinput-replay: set INPUT_PROP_* properties on the device
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/60

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21 15:02:20 +10:00
Peter Hutterer
8684900464 tools: libinput-record: use .yml suffix in the man page
Makes things easier when users save it as yml file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21 15:02:20 +10:00
Peter Hutterer
c54d81b9ec tools: touch-size: update to use the device quirks
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/57

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21 11:48:41 +10:00
Peter Hutterer
404990f125 tools: touchpad-pressure: update man page for device quirks
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/48

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21 11:41:25 +10:00
Peter Hutterer
3b41be9419 tools: touchpad-pressure: add thumb pressure handling
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/49

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 14:01:17 +10:00
Peter Hutterer
ecc406ee53 tools: touchpad-pressure: switch to using quirks for pre-loading thresholds
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/48

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 14:01:17 +10:00
Peter Hutterer
efe954aea8 tools: list-quirks: make the output easier to parse
Print the "has no quirks" to stderr to keep stdout tidy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 14:01:17 +10:00
Peter Hutterer
39cc6d054a tools: list-quirks: print the value of the quirk too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 14:01:17 +10:00
Peter Hutterer
91e6a84f2c tools: list-quirks: add the thumb pressure threshold property
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
201c876ab4 tools: list-quirks: fix usage to read "libinput list-quirks"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
e855605616 tools: list-quirks: compress a condition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:59:20 +10:00
Peter Hutterer
1605f71a0b tools: list-devices: unref the udev device
Fixes a memory leak that prevents us from running list-devices in valgrind.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:26:57 +10:00
Peter Hutterer
7c51c881dc tools: pass a valid grab parameter to list-devices
My kingdome for a compiler warning. Or a scan-build warning. Or a coverity
warning. Or anything... But no, nothing.

Also make the open_restricted() more robust to a NULL userdata, because
effectively that's what we were passing here.

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

Introduced in 0a13223c39

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:26:57 +10:00
Peter Hutterer
8aef361062 quirks: explicitly cast the log priority
The values are the same and this is ABI so they will never change. Make the
cast explicit for coverity's benefit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 13:29:23 +10:00
Peter Hutterer
a5700dcf43 tools: measure touchpad-pressure: prevent division by zero
And make sure the equivalent entry in the measure touch-size is long enough to
overwrite the current status line

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 08:52:21 +10:00
Peter Hutterer
0a13223c39 tools: fix grab argument passing for libinput debug-events
The &grab pointer we used to pass as userdata was the address of the function
argument which goes out of scope at the end of the function. This works fine
for devices immediately opened but when a device connects later, the address
may have been re-used since and it's content is undefined. If not NULL, we
end up grabbing the device.

Instead pass the grab option in which is guaranteed to live until the end of
main.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14 09:50:29 +10:00
Peter Hutterer
000ac14c27 Merge branch 'wip/config-files' 2018-06-11 13:45:50 +10:00
Peter Hutterer
b4ff592a5a tools: libinput-record: put extra guard in to protect from OOB access
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-11 13:43:40 +10:00
Peter Hutterer
d0fa740ad9 Hook up list-quirks --validate for the test suite
All the tests fill fail anyway if the validation fails but this is a quick way
to fail everything early.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-08 14:37:22 +10:00
Peter Hutterer
5792af9a5f 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>
2018-06-08 14:33:35 +10:00
Peter Hutterer
1c325e988f 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>
2018-06-06 11:15:38 +10:00
Martin Wilck
198c53650a 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>
2018-05-25 16:29:20 +10:00
Martin Wilck
c08f2f8988 libinput-measure-trackpoint-range: fix typo
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-25 16:26:45 +10:00
Peter Hutterer
2167c3af05 Merge branch 'wip/custom-pointer-accel-revert' 2018-05-21 12:19:30 +10:00
Peter Hutterer
fbd284ec14 Merge branch 'wip/touchpad-pointer-accel-v7' 2018-05-21 12:19:17 +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
33162632cb 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 d8bd650540.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 12:15:25 +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
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
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