To trigger this, we'd need 1, 2, 3 fingers down, release fingers 1 and 2 but
keep 3 down. Then put finger 1 down again. Touches 1 and 3 are alive now,
touch 2 is in state NONE.
During the thumb detection we took the first touch not in BEGIN and assigned
it to "first" - this would now be the second touch in state NONE.
Real effect is relatively minimal since we only use the coordinates here.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/89
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Measuring the trackpoint range has not shown to be sufficient or precise
enough to be used as an ingredient for trackpoint acceleration. So let's just
switch back to a generic multiplier that we can apply to the input deltas do
undo any device-specific lack of scaling.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This gets rid of the trackpoint range propery that we've been parsing until
now and instead just opts for a basic curve with some deceleration for low
pressure. The speed range is taken from the touchpad and should be wide enough
for most trackpoints that fall within the expected range.
Trackpoints like the new ALPS ones need to be configured through a hwdb (this
part is currently missing).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
destroy isn't called until the last libinput_device_unref(), so we may trigger
a debounce timer after the device was removed. The same fix is neded for the
touchpad interface.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/72
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The tapping code can handle palm states now, so there is no need to disable
tapping altogether when a tool-based palm is detected.
Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/65
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Removed from the udev properties in a55693f87c
but survived here while the branch was in process.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The ssize_t cast upsets coverity for some reason but we can be a lot more
restrictive here anyway. Quick analysis of the zalloc calls in the test suite
show the largest allocation is 9204 bytes.
Let's put a cap on for one MB, anything above that is likely some memory
corruption and should be caught early.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Matheus Santana <embs@cin.ufpe.br>
The values are the same and this is ABI so they will never change. Make the
cast explicit for coverity's benefit.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Ignore motion when pressure/touch size fell below the threshold, thus
ending the touch.
Real world significance: subjectively scrolling/cursor positioning with
a touchpad now a bit better on SAMSUNG NP305V5A laptop.
https://gitlab.freedesktop.org/libinput/libinput/merge_requests/4
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Nothing in libinput needs large buffers, so if we ever get something that
large, we probably passed a negative number to zalloc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make it return NULL for a string array in the form of [ NULL ], like the docs
say. This also adds an extra safety check for the joiner to be of a reasonable
length to avoid overflows.
Found in
https://gitlab.freedesktop.org/libinput/libinput/issues/26#note_6320
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
A bit quirky (haha), because we cannot do this during context creation - we
really want any parsing error messages to show up in the right log file and
the log handler isn't set up during context creation. So we do it on the first
real call to the backend - path_add_device or udev_assign_seat.
Also, failure to initialize the quirks subsystem just means we continue as
normal. This shouldn't be a hard failure, it just means a lot of devices won't
work properly.
If the LIBINPUT_DATA_DIR environment variable is set, that directory is used
for the data file. Only that directory, no custom override file in that case.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We don't want any of the test devices to match the local machine's DMI
modalias. This was a major drawback in the previous test suite, hacking the
dmi modalias string was nontrivial but a wrong string could cause false
positives or negatives.
The quirks system is internal, so rather than having some fancy API we just
hook it off the environment variable that the test suite always sets. Hacky,
but a lot easier than the other options.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
The lenovo compact keyboard with trackpoint has a sensitivity of 5, which
causes the trackpoint range to be 0. This in turn causes inf/NaN during
pointer acceleration as we divide by 0 and makes the cursor go unpredictably
somewhere it probably shouldn't be.
This is part of a wider problem in that the current sensitivity handling
doesn't work well for values well below the default of 128. Any such values
are scaled up to multiples of pixels instead of just working as-is.
Reverting the automatic sensitivity parsing, any systemd udev property set to
change the sensitivity increases it, so we don't run into this bug.
https://bugzilla.redhat.com/show_bug.cgi?id=1583324
This reverts commit a4036a33ca.