Commit graph

4090 commits

Author SHA1 Message Date
Peter Hutterer
8705aba2ea test: add helper functions for checking proximity events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-02 23:46:14 +00:00
Peter Hutterer
736de2f9a7 test: add a comment to a test device
Just so I don't have to look up the git history next time

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-02 23:46:14 +00:00
Peter Hutterer
0a2bbdf6e7 tools: record: record the EV_ABS deltas along with the absolute value
It's useful to have this in the immediate recording. Example output now:

 - evdev:
    - [  2, 300309,   3,  47,       0] # EV_ABS / ABS_MT_SLOT               0
    - [  2, 300309,   3,  54,    3547] # EV_ABS / ABS_MT_POSITION_Y      3547 (+8)
    - [  2, 300309,   3,  58,      70] # EV_ABS / ABS_MT_PRESSURE          70 (-14)
    - [  2, 300309,   3,  47,       1] # EV_ABS / ABS_MT_SLOT               1
    - [  2, 300309,   3,  54,    3112] # EV_ABS / ABS_MT_POSITION_Y      3112 (+4)
    - [  2, 300309,   3,  58,      68] # EV_ABS / ABS_MT_PRESSURE          68 (-4)
    - [  2, 300309,   3,   1,    3547] # EV_ABS / ABS_Y                  3547 (+8)
    - [  2, 300309,   3,  24,      70] # EV_ABS / ABS_PRESSURE             70 (-14)
    - [  2, 300309,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +49ms

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-31 10:40:49 +00:00
Peter Hutterer
2059a015ae tools: fix typo in debug-events man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-31 17:28:15 +10:00
Peter Hutterer
5e25bdfb03 timer: make the timer offset error a bit more user-friendly
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-31 13:03:00 +10:00
Peter Hutterer
da9eace8db tools: record: fix broken event time stamp recording
event->time ended up being an uninitialized field. Introduced in 5dc1a7e, the
event here isn't a struct input event but rather our internal event struct.
Fix this and reshuffle the time handling a bit so it's a bit more obvious
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-30 02:10:33 +00:00
Peter Hutterer
fb1f0a6886 tools: record: wrap the time offset handling into a helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-30 02:10:33 +00:00
Peter Hutterer
8e35a2f949 tools: refuse to replay recordings with timestamps from the future
This indicates a bug in libinput record, might as well complain about it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-30 02:10:33 +00:00
Peter Hutterer
acfec31103 tools: align the tool type names on proximity nicely
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-30 02:10:33 +00:00
Jacob Kauffmann
aa3001668a doc/user: Fix grammar.
Signed-off-by: Jacob Kauffmann <jacob@system76.com>
2020-01-30 00:52:33 +00:00
Peter Hutterer
eb6ef9fe70 touchpad: correct a wrong slot count by the kernel
alps.c hardcodes 5 slots in the kernel but some devices only provide 2 slots
plus BTN_TOOL_TRIPLETAP, etc. Fix this by counting active slots and when the
fake finger count exceeds the active slots but is still less than the number
of slots, adjust the slots themselves downwards.

And because the new test device messes with our slot count assumptions for the
various tests hardcode that one device to return 2 slots.

Fixes #408

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-29 15:58:49 +10:00
Peter Hutterer
56f1ac2b72 test: make the custom touch override methods filter-able
Let those functions return true if they handled the event or false where they
didn't. This makes it more flexible to override touches in special cases only
and fall back to the normal litest handling otherwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-29 15:58:49 +10:00
Peter Hutterer
8fdeba9ea2 test: wrap slot counting into a helper function
This is prep work for future devices that announce a wrong slot count. For the
tests this can be a problem if we rely on the correct slot count to decided
whether to run a test or not.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-29 15:58:49 +10:00
William Brown
63ac196def Improve git commit section
It wasn't clear about the Signed-of-by requirements, so this has been
improved with an example, and clarifies that it is a requirement, not
optional.

Signed-off-by: William Brown <william@blackhats.net.au>
2020-01-29 13:32:55 +10:00
William Brown
e5a6200a8e Small improvements to contributing for accessibility.
This makes a small number of changes that can help improve onboarding
and diversity of contributors. Key to point out is that the code of
conduct is now one of the first items, to highlight the community
standards (rather than being at the bottom where it can be
overlooked). The use of the work "hack" often is off putting to
many people, so replaced with "work". Additionally, changed
the introduction to highlight a desire to be inclusive.

A follow up you probably could do, is have a "how to prepare the
development environment" aka "what depenedencies do I need for
my distro to build the project.

Much of this has come from experience working with outreach/diversity
experts, and my own experience on

http://www.port389.org/docs/389ds/contributing.html

Signed-off-by: William Brown <william@blackhats.net.au>
2020-01-29 13:21:02 +10:00
Peter Hutterer
78e22d5910 doc/user: explain the gitlab issue tags
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-21 11:47:42 +10:00
Peter Hutterer
63169c8252 doc/user: some minor improvements
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-21 11:47:42 +10:00
A. Wilcox
ab377baa12 evdev-fallback: Use input_event_init for fallback
Old-style field initialisation ignores the 64-bit time_t change in
Linux UAPI, which causes the structure to be incompletely initialised
on 32-bit systems with the 64-bit time_t kernel headers.

This patch uses the input_event_init helper from the original 64-bit
time_t enablement patch.

Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Fixes: 5dc1a7ebd ("Adjust for 64bit time_t for 32bit architectures")
See-Also: libinput/libinput!346
2020-01-20 03:37:57 +00:00
Peter Hutterer
2fe672ecee gitlab CI: retry the VM jobs on script failure
Unfortunately the various VM jobs are timing sensitive and create a bunch of
false positives if the runners are under load and miss out on some of the
events (the tablet proximity handling is a particularly bad test here).
Let's retry on failure first to give the CI more opportunity to maybe succeed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-20 11:25:22 +10:00
Peter Hutterer
2d77260ba5 doc/user: expand the contributing document and make it top-level
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-20 09:14:44 +10:00
Peter Hutterer
ce8b256f91 tools: fix abort caused by the pointing stick integration quirk
See #400

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-15 14:12:12 +10:00
Peter Hutterer
9149c09a3b test: switch from counting slot max to num_slots
Much more human-readable this way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-09 05:58:53 +00:00
Peter Hutterer
b4fa301d1f test: simplify a slot count check
Smaller than 3 and greater or equal to 4 means - well, anything that's not 3.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-09 05:58:53 +00:00
Peter Hutterer
62df51789b test: fix some wrong touchpad slot range checks
This was excluding tests from some touchpads due to slot count confusion.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-09 05:58:53 +00:00
Michael Forney
25a940a549 litest: Fix warnings about discarded qualifiers with check-0.13.0
check 0.13.0 introduced a new struct type TTest for test functions
instead of just a function. However, now the tcase_add_* functions use
`const Ttest *`, and since litest stores the test case in a `void *`,
we get warnings like the following:

../test/test-touchpad.c:7079:30: warning: passing argument 3 of '_litest_add' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  litest_add("touchpad:fuzz", touchpad_fuzz, LITEST_TOUCHPAD, LITEST_ANY);

To fix this, use `const void *`, which is compatible with both APIs.

Signed-off-by: Michael Forney <mforney@mforney.org>
2020-01-03 18:31:33 -08:00
Peter Hutterer
4d15fdf3e8 libinput 1.15.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-03 16:44:03 +10:00
Peter Hutterer
148b147173 test: indentation fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-03 16:44:03 +10:00
Peter Hutterer
bfc4980754 test: add the test cases to the suite in the utils tests
oops...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-03 16:44:03 +10:00
Peter Hutterer
5c04bc1851 doc/user: fix some HTML formatting
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-02 22:30:22 +00:00
Björn Daase
b80413f2d5 quirks: fix horizontal scrolling for Logitech MX Master 2S on bluetooth
It turns out that the MX Master 2S also has a different PID when connected
via bluetooth, causing horizontal scrolling to not work properly. Fix this,
by also adding it with the blueetooth PID (according to
https://github.com/libratbag/libratbag/blob/master/data/devices/logitech-MX-Master-2S.device
and in line with local testing) to the quirks file.

Signed-off-by: Björn Daase <bjoern@daase.net>
2019-12-26 11:09:00 +01:00
Peter Hutterer
565f9470ff meson.build: re-add missing trailing slash to the HTTP link
Got lost in 61f81ec93e

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-23 10:57:53 +10:00
Peter Hutterer
104e4a7d49 gitlab CI: update to latest ci-templates
Rebuild all the images to make sure this still works fine.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-12 09:00:04 +10:00
Anatolii Lishchynskyi
970b5aff59 quirks: ignore mode switch button on Madcatz R.A.T.3 mouse
Avoid stuck buttons, so window managers won't behave buggy, for example:
* You click on one window, but click is emulated in another one
* You hover cursor over button/link but see no feedback
Based on quirk for Cyborg mouse.

Signed-off-by: Anatolii Lishchynskyi <iamnotacake@protonmail.com>
2019-12-11 09:45:49 +00:00
Peter Hutterer
6c55880a7d gitlab CI: fix skopeo copy
skopeo doesn't handle the destination credentials correctly

See ci-templates commit 0a9bdd33a98f05af6761ab118b5074952242aab0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-11 15:29:11 +10:00
Peter Hutterer
1f49167b69 gitlab CI: use a minimal alpine image for the commit checks
This runs at the same time as the other images being created so it'll fail if
the image itself doesn't exist yet. Since we only need pip here, let's use
alpine and install the two packages we need.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-11 12:25:56 +10:00
Peter Hutterer
8f0af85072 libinput 1.14.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-05 13:50:24 +10:00
Peter Hutterer
6c2125d1df gitlab CI: add an explanatory comment why we're hardcoding master
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-05 10:40:40 +10:00
Peter Hutterer
9d996a0420 gitlab CI: add a local emulation mode to the gitlab CI script
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-05 10:40:40 +10:00
Peter Hutterer
902806c750 gitlab CI: make the commit check errors more verbose and useful
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-05 10:40:40 +10:00
Peter Hutterer
7f2749a03d gitlab CI: don't try adding the upstream remote if it exists already
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-05 10:40:40 +10:00
Peter Hutterer
11e97c2e64 Expand the CODING_STYLE with an explanation of commit requirements
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-05 10:40:37 +10:00
Peter Hutterer
2d1bcf982a pad: add LIBINPUT_EVENT_TABLET_PAD_KEY for pad keys
The Wacom Cintiq 24HD and later tablets send specific key events for
hardware/soft buttons. KEY_PROG1..KEY_PROG3 on earlier tablets,
KEY_CONTROLPANEL, KEY_ONSCREEN_DISPLAY, and KEY_BUTTONCONFIG on later tablets.
We ignore KEY_PROG1-3 because starting with kernel 5.4 older tablets will too
use the better-named #defines.

These differ from pad buttons as the key code in itself carries semantic
information, so we should pass them on as-is instead of mapping them to
meaningless 0-indexed buttons like we do on the other buttons.

So let's add a new event, LIBINPUT_EVENT_TABLET_PAD_KEY and the associated
functions to handle that case.

Pad keys have a fixed hw-defined semantic meaning and are thus not part of
a tablet mode group.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-04 15:38:39 +10:00
Peter Hutterer
27fda918d8 pad: switch the button mapping to one that can handle keys or buttons
No functional changes, we still use the same bits everywhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-04 15:31:46 +10:00
Peter Hutterer
9696f37393 tools: debug-events: don't overrun the device array with too many arguments
Only the --device option was checked for argument count, not the rest so it's
easy to overrun the array by specifying too many devices.

Except: this was a theoretical bug only, more than 64 arguments trigger
an assertion in the argv processing in tools/shared.c anyway. Let's drop the
debug-events limit to 60 devices so we can at least have a test for this.

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-04 12:50:11 +10:00
Peter Hutterer
b8bbf424de gitlab CI: run the meson script for the VMs as well
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-28 14:36:00 +01:00
Peter Hutterer
142399f8a3 gitlab CI: move the build instructions into a bash file
Extending/debugging scripts in the gitlab CI directly is a pain, the
turnaround cycle is terrible. Let's move this into a shellscript that we can
just call directly.

Bonus side-effect: if we wanted to extend the script: set somewhere, this is
now much easier to override.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-28 14:35:55 +01:00
Peter Hutterer
3f051ca9d8 gitlab CI: add meson to junit script
This script was written by Emmanuele Bassi, copied from
https://gist.github.com/ebassi/e5296ec77ae9e0d3a33fd483b5613b09/

It converts meson test results into a junit file which we can then use to
display in the merge request GUI.

Note that as litest writes out junit files as well, some tests are reported
twice. Specifically: where litest fails the failure will be reported once
through litest itself and once by meson test. Oh well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-28 11:52:54 +01:00
Peter Hutterer
3ac525db19 test: write our test case results out as junit xml files
libcheck has the ability to write out XML files for test results, but
converting those into junit isn't ideal, for a number of reasons:
- junit xml is different to libcheck's xml, so not all data is available or
  useful. Especially with our litest wrappers around it.
- litest forking off tests means we have to wrap around everything anyway to
  avoid multiple forks writing to the same test file.

This is the minimal implementation since it's only user is likely the CI which
we control fairly tightly. So there are a few corners we can skip:
- no filename validation is performed by litest
- we write out a lot of junit xml files (one per litest fork). Rather than
  collating those we just rely on the CI to find the files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-28 11:52:54 +01:00
Peter Hutterer
773b322e8b gitlab CI: apply some basic validity checks on the commit messages
Let's stop merge requests from users that don't set their git author name and
email address. Aside from it looking stange in the history it'll also make it
virtually impossible to ever find that user again should something important
arise in the future - especially if we switch off gitlab.

The rest is basic style, short subject lines, Signed-off-by lines and correct
formatting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
[bentiss: use /usr/bin/env python3 as requested by the CI]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-11-28 11:43:26 +01:00
Peter Hutterer
c63c3b2f7b gitlab CI: rename the container_prep state to just "prep"
So we can shove other stuff in there without it looking strange.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-28 11:15:27 +01:00