Commit graph

480 commits

Author SHA1 Message Date
Peter Hutterer
32bf9f2990 tools: fix waiting for the tool to quit in the options test
Just use the wait() timeout directly instead of sleep and kill. This allows us
to have a longer timeout and still get fast handling where the tool
immediately exits, but less failure when running on busy machines.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 13:41:03 +10:00
Peter Hutterer
80a52c28df tools: use American spelling for 'unrecognized'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-08 11:19:51 +10:00
Peter Hutterer
274b80d06c tools: switch measure-touchpad-tap to python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
33afe9f875 tools: switch measure-touchpad-pressure to python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
deb759a069 tools: switch measure-touch-size to python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
795c08eb44 tools: switch measure-fuzz to use python-libevdev
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 04:33:11 +00:00
Peter Hutterer
247b2344a5 tools: record: increase value size to 6 digits
Tablets commonly have higher axis ranges, might as well make sure they line
up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 09:45:29 +10:00
Peter Hutterer
56dfa2f6c0 test: fix tool option parsing tests for signals
Not sure how this ever worked correctly: a process terminated by a signal has
the negative signo as return code. This would apply to every debug-events and
debug-gui test because they have to get killed by a signal. This failed
occasionally, presumably a race with the GTK startup/signal handler/whatever.

Fix this by a) sending SIGQUIT because that won't get handled by the tools and
b) prending that if we get a -SIGQUIT exit code, everything is fine.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-28 15:47:31 +10:00
Peter Hutterer
79293ea456 tools: fix the tool option parse test to handle unittest arguments
Pass arguments we don't handle directly through to the unittest module. This
way we can filter tests with -k testname etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-28 15:47:31 +10:00
Peter Hutterer
26702e4d73 Fix three coverity complaints
Two resource leaks, one uninitialized variable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-25 15:15:13 +10:00
Peter Hutterer
a4b9813b92 tools: flake8 fixes, typo fixes and missing exception handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-15 12:01:51 +10:00
Peter Hutterer
d4f5faae0d tools: move the builddir lookup function out to a separate file
We want to use this from the tests as well soon, so let's move it to a more
generic location. This also changes the API to be slightly more sensible, a
free() is the same cost (and safer) than passing a static buffer in and hoping
we didn't get the size wrong.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-14 11:28:05 +10:00
Peter Hutterer
d7282a3d9d tools: skip the option parsing test during valgrind
We don't want to valgrind through python...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-12 15:10:15 +10:00
Peter Hutterer
1150a8442f tools: display the discrete axis steps too
Draw a second smaller scroll bar that moves with every discrete step. For that
to work, we have to accumulate the value from the normal scroll events until
we get the first discrete one, then move up.

The value per discrete event changes depending on the click wheel angle, so we
can't just use discrete on its own if we want the two scroll bars aligned.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 15:47:27 +10:00
Peter Hutterer
d213804de8 tools: group the scroll bits into a struct
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 15:47:27 +10:00
Peter Hutterer
1272db297a tools: record: print a helpful error message when we don't have devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-04 04:54:27 +00:00
Peter Hutterer
e0008d3dc2 tools: debug-gui: change the tablet color
Grey isn't pretty enough

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:08:51 +10:00
Peter Hutterer
f954cb29e4 tools: debug-gui: add a previously unbalanced cairo_restore()
And remove some of the unnecessary ones

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:02:13 +10:00
Peter Hutterer
c1ee05fb9a tools: debug-gui: move the pointer delta code to draw_pointer
Not sure why this was in draw_tablet(), probably copy/paste

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-14 13:02:13 +10:00
Peter Hutterer
e038a22360 tools: draw the tablet before the touch points
On the Dell Canvas Totem, the tool will cancel existing touch points and to
visually debug that, we need the touchpoints to be drawn over the tool.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 18:45:04 +10:00
Peter Hutterer
5b85cf06d8 tools: draw other buttons in the debug-gui
Buttons that aren't lmr are drawn in a separate button square now with the
name as it comes from the kernel. This only handles one button at a time, but
it'll do for debugging.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
335fe99a32 tools: debug-gui: move the lmr button handling into a substruct
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
790a301d13 tools: debug-gui: show cancelled touches as unfilled circles
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-02-13 07:26:54 +00:00
Peter Hutterer
c8599ea2ae tools: document show-keycodes option for libinput-record
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-17 10:00:30 +10:00
Peter Hutterer
b8a04553de tools: libinput-record: record the hid report descriptor where available
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 15:24:04 +00:00
Peter Hutterer
29e83bcf94 tools: measure-fuzz: slightly expand the help
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 04:59:48 +00:00
Peter Hutterer
b11fe3e91a tools: measure-fuzz: fix a typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 04:59:48 +00:00
Peter Hutterer
447551aafb tools: measure-fuzz: downgrade the fuzz mismatch error to just a warning
Related to #199

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-01-02 04:59:48 +00:00
Peter Hutterer
a904738730 tools: measure-fuzz: fix exception printing
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/x86_64-linux-gnu/libinput/libinput-measure-fuzz", line 464, in <module>
    main(sys.argv)
  File "/usr/lib/x86_64-linux-gnu/libinput/libinput-measure-fuzz", line 458, in main
    print('Error: {}'.format(e.message))
AttributeError: 'InvalidConfigurationError' object has no attribute 'message'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>:
2019-01-02 04:59:48 +00:00
Peter Hutterer
96a0e8ed66 tools: don't apply config options on device removed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-12-19 15:55:42 +10:00
Peter Hutterer
b033bc2677 tools: draw evdev events in the debug-gui
Listen to the pure evdev events from each device and print them. This makes it
slightly easier to associate certain jumps with the output, or otherwise see
that events are coming in even when libinput doesn't seem to process them
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 15:22:20 +10:00
Peter Hutterer
4e469291b1 tools: let debug-events take a device path
This is the most common use-case other than "all from udev", so let's just
parse a device path correctly without requiring --device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
5cd27b070e tools: add a test for tool option parsing
We don't check for correctness in the output as such, just that whatever
combination of cmdline arguments still works/doesn't work. This is the
scaffolding and a few tests, but needs to be filled in, especially for
libinput measure and for some more complex combinations.

valgrind: requires one more python-related suppression
gitlab-ci: requires another environment variable so we know to skip the
	   --device tests (udev will time out on those)
meson: skip the test run in release builds, we pass the full path to the built
       libinput tool but rely on the subtool lookup that won't work in a
       release build

Fixes #174

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
36af7d312b tools: make the tools exit with exit code 2 on usage issues
This makes it easier to test for usage issues

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
bd52bf5421 tools: debug-events: install the signal handler before any libinput operations
On a CI container, we will time out trying to find the udev device for our
device node. This takes 2s, a SIGINT during this time should be treated the
same as one during the mainloop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
22890a4719 tools: handle sigint in debug-gui
Exit with success on SIGINT

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-07 05:03:52 +00:00
Peter Hutterer
27bf3fb2ab tools: allow measuring single-touch ABS_PRESSURE
Fixes #173

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-06 00:24:06 +00:00
Peter Hutterer
fcfffd80d7 tools: drop a superfluous linebreak in the list-quirks output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-05 14:28:13 +10:00
Peter Hutterer
48a7c507f8 tools: handle the EventCodeDisable quirk in the quirks tool
This caused an assertion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-11-05 14:28:13 +10:00
Peter Hutterer
717b57b6a2 tools: align the rotation value with 3 digits
This is a 0-360 ranged value, so let's print it aligned.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-27 10:27:19 +10:00
Peter Hutterer
6ed158f99d tools: add a missing space in the proximity in axis listing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-27 10:27:19 +10:00
Peter Hutterer
6e1f6d4182 quirks: replace the manual enumation of all quirks with a loop
Reduces the places we need to update bits for new quirks.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-20 12:56:11 +10:00
Peter Hutterer
973a895d39 quirks: sort the quirks model flags in alphabetical order 2018-09-20 11:53:48 +10:00
Peter Hutterer
d616218c9a tools: fix a bunch of format conversion complaints
Fixes #137

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-12 13:28:16 +10:00
Peter Hutterer
cb49e90472 tools: drop the libinput measure trackpoint-range tool
This tool is now obsolete, we don't use that range anywhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-11 13:18:48 +10:00
Peter Hutterer
bf9c8e06ef tools: debug-events - print axes on tablet tip events
Bit of a weird diff, print_tablet_axes() was moved up and a single call to
print_tablet_axes() was added in the tablet tip event handler.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-09-05 14:33:28 +10:00
Peter Hutterer
0e2f1babc5 quirks: add a quirk to monitor MSC_TIMESTAMP for pointer jumps
Currently enabled on all Dell i2c touchpads, these seem to be the ones that
needed it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-31 11:12:42 +10:00
Peter Hutterer
a661d7b717 tools: handle a finger down at startup for measure pressure/touch-size
Fixes #117

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-29 22:17:33 +00:00
Peter Hutterer
66ac659e36 touchpad: add support for size-based thumb detection
Fixes #97

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-29 16:35:14 -05: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