We need to remember whether a tap was down or just hovering, otherwise we mess
up the state machine when we send tap release events for taps that never
switched to TOUCH_BEGIN. This is quick fix, really we should have a new state
here, but that's a lot harder to implement.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
As we switch to pressure-based touch detection, we need for all
pressure-capable touchpads to send pressure values. They'll do so by filling
in an axis default but that breaks our current hover code.
Make sure the hover litest helpers force a pressure of 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Extra insurance against broken lid switches. Listen to events from the
(internal) keyboard when we are logically closed. If any, assume we're open
after all and update accordingly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This changes the default behavior to "disable the touchpad on the first lid
close event", thus filtering any laptops where the switch state is buggy and
always in "on" state. Devices where we know the lid switch state is
reliable can be marked as such.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is the default behavior, based on the theory of hardware actually doing
the right thing. That's not always the case, follow-up patches will change
when we do the theoretically ideal thing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Ship a custom udev rule for the test device until systemd v333 is commonplace.
Signed-off-by: James Ye <jye836@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This will allow switch devices known to libinput to be exposed. Currently,
this is SW_LID.
libinput also handles switch events internally, e.g. a laptop touchpad will
be disabled autmoatically when the lid is closed. This is transparent to
the caller, although the caller will also receive the event. See
https://bugs.freedesktop.org/show_bug.cgi?id=86223
This features is intended to be the main driver for the interface.
Co-Authored-By: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: James Ye <jye836@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Nothing actually called that function, sprinkle a few calls into existing
tests to make sure it actually works.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The test suite (and tests) we have now all clean up nicely before calling the
final libinput_unref(). Add one where there's at least one device still
connected.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
./configure --enable-gcov adds the required flags to link everything ready for
gcov. A new make gcov target runs the test suite, then pulls all the gcov bits
together into ./test/gcov-reports/ including a summary file.
The script to pull everything out is used in libevdev too, we just have an
extra condition here to ignore the selftest gcov bits (it overwrites the
useful litest.c coverage output).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
These conditions were never triggered by our test suite, so let's tighten up
the tests to match what we expect.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The first event is always a device added event, skip the loops that would
paper over this. If we ever change this, the tests *should* fail.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The second condition was never triggered because we shouldn't get anything but
keyboard events here. Drain the initial event burst and remove the two
skipping conditions that won't happen anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
I'm using semaphore CI for build testing and that only provides Ubuntu 14.04
which doesn't have libevdev 1.3 or later.
Since this is a minor workaround for an error case only, revert the commit
again and leave the handling in. Less effort than having to patch around it in
semaphore.
This reverts commit 1e0736daf3.
gcov analysis showed that none of the actual testing conditions were hit, so
the test succeeded despite not actually testing anything. Which is good,
because testing for tilt normalization isn't correct anyway, tilt is in
physical degrees,
Drop the test and replace it with a test for pressure normalization instead.
We already have a similar one to check for [0, 1] range, this new one
explicitly tests for the extents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
They weren't originally prefixed but the various tests were, but now that we
only have one test runner binary anyway, the prefix helps sorting the files
easily within e.g. gcov results.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Use the litest_assert_empty_queue() instead of manual checking, and remove the
manual checks after the function call.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
These were just there so we didn't have an unused variable warning, but
there's no reason even assigning to anything in the first place
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We used to mark dell touchpads this way but let's make this more generic.
Nothing else used the dell touchpad model flag, so we can simply replace it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>