Commit graph

3740 commits

Author SHA1 Message Date
Peter Hutterer
9deb57e9b5 tablet: move tablet tool change processing to tablet_flush
Unlike virtually everything else, the tablet tool was processed at the time
the event was read rather than when the subsequent EV_SYN came in. This causes
difficulties with tablets that send the wrong BTN_TOOL_PEN events.

Moving the tool change processing to tablet_flush() makes the injection of the
BTN_TOOL_PEN event a lot easier, simply flipping the matching bit does the
job. It also makes it easier to ignore duplicate tool updates like we've seen
in #259.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-30 12:31:51 +10:00
Sebastian Krzyszkowiak
48236ca174
CI: update arch package list
Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
2019-04-14 14:48:40 +02:00
Sebastian Krzyszkowiak
7618c961a8 evdev-mt-touchpad-buttons: use a model quirk instead of vendor ID to identify Apple devices
Recent Apple touchpads use a proper Bluetooth vendor ID assigned to Apple instead of the USB one,
so this code would have to check for two vendor IDs and their udev types. However, we already
have that matching done via models in quirks, so let's just use that.

Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
2019-04-14 05:51:46 +00:00
Sebastian Krzyszkowiak
a99793f256 quirks: add a new Apple vendor ID for Bluetooth devices
Also, set a default AttrTouchSizeRange for Apple touchpads via Bluetooth
to match the one from the USB rule.

Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
2019-04-14 05:51:46 +00:00
Jason Gerecke
657842093c test: abort when no default value is available for an axis
And fix the cases where the default value isn't filled in correctly

Issue found because of the following ubsan error:
../src/evdev-tablet.c:182:19: runtime error: signed integer overflow: 0 - -214783648 cannot be represented in type 'int'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-11 17:50:09 +10:00
Jason Gerecke
09e97a5231 test: Clean up memory leaks
A few leaks in the test code were found when running linput-test-suite
with the -fsanitize=address option enabled. Clean up these leaks so that
we can more clearly see real issues.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-11 17:50:09 +10:00
Jason Gerecke
f589f4968f fallback: Fix ubsan runtime error
Running libinput-test-suite with -fsanitize=undefined highlights the two
following errors. Force C to realize we want an unsigned result by making
the '1' literal unsigned.

../src/evdev-fallback.c:314:22 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
../src/evdev-fallback.c:377:24 runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

v2: use bit() instead of manual shift 1U<<1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-11 15:07:53 +10:00
Peter Hutterer
8040c459c9 test: add proximity timeout delay to a tablet test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-11 14:59:20 +10:00
Peter Hutterer
1a5474d166 tablet: add a debugging message when we force a proximity out
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-11 14:59:20 +10:00
Peter Hutterer
f45a8c9ed7 tablet: tighten the test for tablet button releases on proximity out
Make sure we check the expected sequence more stringent and change the x/y
coordinates on prox in so the kernel doesn't filter them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 13:42:13 +10:00
Peter Hutterer
2cdda41a3b test: reduce some touch sequences to avoid tablet timeouts
We need to keep those sequences to fall below the tablet proximity timeout.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 13:42:13 +10:00
Peter Hutterer
b8d2fd162a test: fix the hid4800 device's prox out serial number
The test device sent a serial of 0. That would end up creating a new tool in
libinput which is wrong. Let's hope this was just an error in creating the
test device, if the device really sends that sequence, we're in trouble.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 13:42:13 +10:00
Peter Hutterer
1a1b6070c4 test: filter BTN_TOOL_PEN correctly for the mouse tool tests
With the previous code we'd set both tools simultaneously which isn't allowed.
It only worked because the second tool set was the one we cared about.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 13:41:37 +10:00
Peter Hutterer
bdd6f3d40b test: actually filter events when writing to udev
Don't write events to the uinput device if we disabled that specific event
code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-09 13:41:03 +10:00
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
0f44173ff5 tablet: fix some code alignment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-08 11:19:51 +10:00
Peter Hutterer
502e54f93a tablet: add missing linebreak after error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-08 11:19:51 +10:00
Peter Hutterer
9bba14990a tablet: always enable the proximity out quirk
Don't require a quirk update, just enable this by default for all tablets. If
we get a proximity out event at the right time, the quirk is disabled for that
tablet for the rest of its lifetime. And it's virtually impossible to have a
false positive here anyway - you cannot hold the pen still enough to not
trigger events for 50ms.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-08 11:19:19 +10:00
Lubomir Rintel
b31d842ac3 quirks: speed up the TrackPoint on the IBM USB UltraNav keyboard a bit
By default it's unbearably slow.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2019-04-05 19:16:23 +02:00
Peter Hutterer
ca1a75a961 tablet: log a bug when a tablet switches between tools directly
We expect the kernel to transition properly for us, e.g. BTN_TOOL_PEN goes to
0, BTN_TOOL_ERASER goes to 1. Two cases have surfaced recently where this
doesn't happen and debugging this takes time - so let's warn about it to make
it obvious.

Example 1: https://github.com/linuxwacom/libwacom/issues/70
Example 2: https://gitlab.freedesktop.org/libinput/libinput/issues/259

This is just a warning, nothing more. We should just handle that case
accordingly but that requires more effort.

Fixes #260

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-04 05:51:34 +00:00
Peter Hutterer
4912e7ed4a tablet: move the current tool bits into a substruct
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-04 05:51:34 +00:00
Ian Douglas Scott
caadad75c0
Enable ModelTabletNoProximityOut quirk on HP Spectre 13-ap0xxx
Ideally, this should probably match a broader range of devices. But I'm
not sure what it should specify.

Fixes #261
2019-04-03 08:27:40 -07:00
Peter Hutterer
199f179a3f doc/api: minor style changes
Reduces the size of the group name in the title.

Removes the background image from the navpath where it appears (file reference
page for example).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-03 09:42:35 +10:00
Peter Hutterer
4bb2899d00 doc/api: add since tags to all functions after 1.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-03 09:29:32 +10:00
Peter Hutterer
67ddce09bb test: drop some unnecessary extern declarations
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-02 10:48:20 +10:00
Peter Hutterer
e5fdd59b2d meson.build: bump to 1.13.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 16:00:35 +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
Benjamin Tissoires
6d96d417a0 CI: simplify the logic for rebuilding the containers
right now the check_if_older_than_a_week rule does (in pseudo-code):
- get timestamp of current image or 0
- get timestamp of upstream image or 0
- if upstream image is newer than current image
  copy upstream image into current
- if we are in a scheduled pipeline, or if there is no current image
  (timestamp of 0), rebuild the current image

The ci-templates if-not-exists rule does:
- if there is a current image, exit
- if there is an upstream image, copy it to current and exit
- rebuild

Having the following is equivalent to the current behaviour and
can be used instead of check_if_older_than_a_week:
- if there is an upstream image, copy it to current and exit
- if there is a current image, exit
- rebuild

Because what matters is:

forks should be running the upstream image if available
forks should be running the latest upstream image in the libinput case
forks should be able to rebuild the images if there is no upstream
(change of the image tag)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +00:00
Benjamin Tissoires
51e66ab945 CI: do not rebuild the image for regular MR or pushes
We better not rebuild the image in regular operations unless there is a
strong need for it.
We can however set up a scheduled pipeline to rebuild the images once
a week or once a month in the upstream repo, and the forks will fetch
those new images when they need.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +00:00
Benjamin Tissoires
67cdd3d2d4 CI: use templates for Ubuntu
For ubuntu, we need to enable some special packages, so use a script.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +00:00
Benjamin Tissoires
0ff4088aea CI: use templates for Arch
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +00:00
Benjamin Tissoires
e2cdc4efdd CI: use the template for fedora
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +00:00
Benjamin Tissoires
5789e8b930 CI: clean up all but the correct tag
We should rely on the provided tag, not latest.
Move the clean stage at the end, there is no point in running it at
the beginning.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +00:00
Benjamin Tissoires
ab6536682b CI: heavily rework the container creation
Now everybody gets to rebuild their own containers if there is a change
(too old or change in the packages). This should allow the MR touching
the package list to succeed.

Removal of the container_check stage, we can just have this in a
before_script.

Removal of the manual creation of the containers, not needed as we better
just increment <DISTRO>_TAG.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +00:00
Benjamin Tissoires
93cec9197a CI: remove the bootstrapping stage
We want to have a common repo for the containers templates.
So we can reuse the produced image from this repo and remove our custom
bootstrap image.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-04-01 04:11:20 +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
72b3f657c4 quirks: add a test to make sure all our quirks files are listed in meson
Simple diff between the file list and what ls gives us in the quirks
directory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 09:22:43 +10:00
Peter Hutterer
1b1a9f636f meson.build: add the toshiba quirks file to the file list
Was added to git in c741a42aec but not added to
meson's file list.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-04-01 09:21:07 +10:00
Tobias Stoeckmann
a46f7dff6b Removed whitespace from filename.
Having a whitespace at the end of a quirks file is not useful.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-03-29 12:34:27 +01:00
Peter Hutterer
8610c18086 libinput 1.13.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-29 09:39:30 +10:00
Peter Hutterer
31d1aa7f28 test: add another valgrind suppression for Python
This triggers on Fedora 30, even though skip skip the tools options test when
running under valgrind.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-28 16:14:08 +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
5d7c93a3d1 doc/api: improve readability of the API docs
Still not great and probably makes any professional designer's eyes bleed, but
at least it's more readable now.

Changes:
- spacing after param name so they don't cuddle up with the description
- color changes and background image removals to drop the doxygen default look
- font size changes to not make things overrun
- font family change to make the function prototypes readable

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-27 16:01:10 +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
2edc7e37ac test: mark the protocol A device as touch device
Now that we're emulating everything correctly, let's mark it as proper touch
device.

Two test cases need to be excluded:
- double-down triggers an assert in the test device because this isn't
  possible this way with protocol A devices
- the axisrange warning test can't be triggered, mtdev clips those axes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-03-22 16:23:17 +10:00