Commit graph

129 commits

Author SHA1 Message Date
Peter Hutterer
36d8155dbe test: add --gen-suppressions=all to the valgrind run
Because if we have a heisenbug that can't be reproduced on other machines,
having the suppression output in the log can save a lot of time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-23 18:45:36 +10:00
Greg V
4e3ea4b8e6 Autodetect and use libepoll-shim on FreeBSD 2018-07-18 21:07:24 +03:00
Greg V
d23074cec9 test: ptrace compatibility with *BSD 2018-07-16 13:48:54 +03:00
Greg V
ef9b7e889d Use getprogname() when program_invocation_short_name is not defined 2018-07-16 13:44:15 +03:00
Greg V
0e03784e47 Fix include portablity (xlocale, stdlib) 2018-07-16 13:44:15 +03:00
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
deadbf35c4 doc: move the meson.build in as subdir()
Doing so means we can ditch the specific input list for doxygen and just copy
all files over into our builddir/doc/ subdir, then use that subdirectory as
input data.

This relies on meson putting a subdir() into a subdirectory in the build
directory. This isn't technically guaranteed but I also suspect that if meson
ever changes that, lots of other projects will break. Even in that case we
should build just fine since we now filter for *.h and *.dox and don't copy
any other doxygen-commented files into the builddir anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-12 14:05:52 +10:00
Peter Hutterer
6b73d93ca4 test: tidy up the symbols leak test
This hasn't been a real .in file since the autotools removal, so rename it to
reflect that. And since we can call it with arguments from meson, let's do so
in the most sensible manner - passing the full paths in as required rather
than relying on a directory layout within the script.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-12 11:09:00 +10:00
Peter Hutterer
fa66edcd73 meson.build: move the directory path generation to a single section
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-12 11:08:54 +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
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
ff15bfd99f doc: drop the git version into the documentation
The libinput/doc/latest is now built automatically from git, so it's good to
have a reference to show which commit it was being built from. Add a section
to the readme with git commit information that is replaced by meson.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-06 11:04:07 +10:00
Peter Hutterer
d2cd727c9b Switch to using files() for the doxygen input sources
Using files() over a list of hand-constructed paths is the recommended way.
But unfortunately doxygen needs its input files as a string list, so we still
have to build that list anyway. Still, this way we don't need to hardcode
every file with the source root, we just assemble it as we go.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-06 11:03:37 +10:00
Peter Hutterer
45e3218863 doc: build doxygen output into "Documentation"
Slightly more obvious than just "html". Main motivation here is that we want
to provide the documentation as artifact from GitLab's CI, so having it unzip
to something slightly more meaningful makes sense.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-07-05 10:29:50 +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
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
5ca1862bde test: add a libinput-test runner for 'deviceless' tests
These are tests that don't need *any* uinput devices at all. Mark them
accordingly and create a new binary that only runs those tests. This way we
can run some of the test suite even in containers where we're restricted.

Better have 10% tested than none, I guess.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-26 11:18:31 +10:00
Peter Hutterer
307f4a5636 meson.build: add more overrides for coverity
"/usr/include/math.h", line 381: error #20: identifier "_Float32" is undefined
  # define _Mdouble_		_Float32

Same for a few others. Since we don't actually need those anyway, we can just
cast those to the some close-enough sizes. We don't have stdint.h in config.h
and meson cannot have a custom #include line in the config object. So let's go
with what does the job for now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Matheus Santana <embs@cin.ufpe.br>
2018-06-20 11:41:48 +10:00
Peter Hutterer
4203ab52bf meson.build: add a libinput list-devices run to the test suite
This will only catch a segfault or some other bug since we don't actually look
at the output. But that's still better than not running it at all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-20 11:26:57 +10:00
Peter Hutterer
870ddce9e4 Drop the udev hwdb model quirks
Replaced with the quirks files in merge commit
000ac14c27

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-18 11:04:43 +10:00
Peter Hutterer
d4a91c0a00 meson.build: always build some tests
Make the meson -Dtests=false option only apply to the libinput test suite
itself which has extra dependencies, etc. The build tests and symbol leak
tests should always run.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-14 15:07:15 +10:00
Peter Hutterer
da3e4ccb6b meson.build: bump to 1.11.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-13 15:45:27 +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
5e4dee22fd 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>
2018-06-08 14:33:35 +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
3b9c665357 libinput 1.11.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-04 10:16:55 +10:00
Peter Hutterer
cf6d7e8de3 libinput 1.10.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-30 09:42:06 +10:00
Peter Hutterer
6127a243d1 libinput 1.10.901 2018-05-22 11:13:27 +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
8178339b5b 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>
2018-05-16 14:23:12 +10:00
Peter Hutterer
3251ba2af0 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>
2018-05-15 13:51:33 +10:00
Peter Hutterer
d8bd650540 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>
2018-04-26 14:48:37 +10:00
Peter Hutterer
d8e8b74b06 filter: split the mouse acceleration out into a separate file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:52:00 +10:00
Peter Hutterer
6135e1d878 filter: split the low-dpi acceleration into a separate file
Plenty of duplication there from the normal filter.c, but that also makes it
less likely to break if we adjust the other one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:24:52 +10:00
Peter Hutterer
f61adfcf9b filter: move the flat filter into a separate file
This also fixes a bug with the _noop function, because we casted to the wrong
struct the dpi value was garbage.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:15:38 +10:00
Peter Hutterer
b887353ab9 filter: split the touchpad acceleration code into a separate file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:15:38 +10:00
Peter Hutterer
477f51b6bd filter: split trackpoint acceleration code into a separate file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:15:38 +10:00
Peter Hutterer
f79b2d4df4 filter: split the tablet accel code into a separate file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:15:38 +10:00
Peter Hutterer
d857e36c33 filter: move the x230 filter into a separate file
There's a fair bit of duplication of code from filter.c but it's not worth
disecting this and optimising it. The device is 5 years old now, we don't want
to touch this accel method so duplication is good here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:15:38 +10:00
Peter Hutterer
bcdd722929 meson: re-use the filter source list
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-18 16:15:38 +10:00
Peter Hutterer
08d85350cb test: add a test for a touchscreen with out-of-range axes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-16 17:04:46 +10:00
Peter Hutterer
108b85cae0 doc: add a description of the internal architecture
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-16 15:14:23 +10:00
Peter Hutterer
8a223e739b Drop the libinput-list-devices and libinput-debug-events compat scripts
Added in 1.8, let's drop them for 1.11

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-13 14:58:46 +10:00
Peter Hutterer
e428e5e87a meson: only run the selinux restore script on meson < 0.43
Meson handles this now, see meson commits 1826872 and follow-up c63aa037.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-13 14:58:46 +10:00
Peter Hutterer
75aee30919 test: add a script to check for leftover litest rules
An aborted test run can sometimes leave udev rules as detritus. Test for that
so we don't get test case failures triggered by those rules.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-23 12:41:23 +10:00
Peter Hutterer
e5cc1131b2 meson: point users to disabled documentation when dot/doxygen is missing
Especially dot is hard to find for some users, so provide the solution to
their problems right there in the error message.

And because users are likely to just copy/paste, remove the disable-libwacom
option. Save them from themselves...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-20 15:32:01 +10:00