Peter Hutterer [Wed, 27 Sep 2017 03:50:11 +0000 (13:50 +1000)]
test: if we're not root, return with status 77
exit code 77 signals "skip this test"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 04:40:59 +0000 (14:40 +1000)]
fallback: suspend internal keyboards and trackpoints on tablet-mode switch
Because on some devices the keyboard is where the fingers are holding the
device when in tablet mode.
https://bugs.freedesktop.org/show_bug.cgi?id=102729
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 04:10:49 +0000 (14:10 +1000)]
fallback: add 'interface' to the fallback interface's method names
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 03:19:36 +0000 (13:19 +1000)]
touchpad: invert an if condition to allow for early return
if (foo) {
everything
}
changed to :
if (!foo)
return
everything
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 03:57:50 +0000 (13:57 +1000)]
fallback: move the fallback code into a separate file
Split out the fallback-specific device handling from the more generic
evdev-specific handling (which is supposed to be available for all devices).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 03:56:43 +0000 (13:56 +1000)]
evdev: rename evdev_key_type to just key_type
This is a fallback-specific private enum, don't pretend it's evdev-related
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 03:45:22 +0000 (13:45 +1000)]
evdev: abstract the get_switch_state method
Shove it into the generic dispatch interface so we don't entangle evdev and
fallback.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 03:28:58 +0000 (13:28 +1000)]
Use named initializers for the various dispatch interfaces
Better for self-documentation than comments and makes it more obvious if we
initialize something wrongly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 03:16:22 +0000 (13:16 +1000)]
evdev: change prefix on some fallback-only methods
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 Sep 2017 04:35:46 +0000 (14:35 +1000)]
Merge branch 'wip/litest-use-sections-for-tests-v2'
Peter Hutterer [Tue, 19 Sep 2017 00:10:22 +0000 (10:10 +1000)]
fallback: allow for multiple keyboards to toggle the lid switch
Previously we only listened for events on the first one to come up, based on
the assumption that there can only be one internal keyboard. The Razer Blade
laptop keyboards come with with multiple event nodes, all looking like a
normal keyboard. The one that comes up first is one for special keys, so
typing on the internal keyboard after a lid switch does not toggle the write
state.
Fix this by allowing for up to 3 keyboard listeners for a lid switch.
https://bugs.freedesktop.org/show_bug.cgi?id=102039
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 Sep 2017 05:56:29 +0000 (15:56 +1000)]
test: fix test listing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 Sep 2017 05:55:18 +0000 (15:55 +1000)]
test: fix no-device test name handling
All these tests were stored with "no device" as test name.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 Sep 2017 05:56:29 +0000 (15:56 +1000)]
test: fix test listing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 Sep 2017 05:55:18 +0000 (15:55 +1000)]
test: fix no-device test name handling
All these tests were stored with "no device" as test name.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 23:25:04 +0000 (09:25 +1000)]
test: switch to a TEST_DEVICE macro for all the litest test devices
The test device initialization code was a bit of duplicated boilerplate and
required adding a reference to the devices to the 'devices' list in litest.c.
Automate this with a new TEST_DEVICE macro that adds the devices to a custom
section in the binary, then loops throught that section to get the device out.
This reduces the boilerplate for each test device to just the TEST_MACRO and
the LITEST_foo device enum entry. It also now automates the shortname of the
device.
The device's shortname was standardised in this approach as well, lowercase
and dashes only.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 23:23:24 +0000 (09:23 +1000)]
test: add missing newline to an error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 08:52:46 +0000 (18:52 +1000)]
test: drop obsolete semi-mt allocation for the atmel hover device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 23:08:12 +0000 (09:08 +1000)]
test: fix the 'all codes' keyboard device
The ...create() method returned the wrong device, so this one was never
actually used. Once we start using, we get test case failures related to the
device having BTN_foo events as well. For now, just disable those codes so we
have a keyboard with all keys and pass the tests. The rest needs better
fixing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 05:51:09 +0000 (15:51 +1000)]
timer: flush the timer funcs if our events come in late
Avoid processing an event with a time later than the earliest timer expiry. If
libinput_dispatch() isn't called frequently enough, we may have e.g. a tap
timeout happening but read a subsequent input event first. In that case we can
erroneously trigger or miss out on taps, see wrong palm detection, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Wed, 20 Sep 2017 00:50:19 +0000 (10:50 +1000)]
tablet: always enable the no-proximity-out quirk on HUION tablets
And instead disable it when we do get a proximity out.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Wed, 20 Sep 2017 23:07:49 +0000 (09:07 +1000)]
evdev: update key type check for new key defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 Sep 2017 23:05:32 +0000 (09:05 +1000)]
include: sync linux kernel header files with 4.12
To get the new key defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 03:23:48 +0000 (13:23 +1000)]
evdev: add a comment to the toggle_touch interface
And remove an unnecessary one
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 03:59:06 +0000 (13:59 +1000)]
evdev: drop unused #define DEFAULT_TRACKPOINT_ACCEL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 Sep 2017 04:00:05 +0000 (14:00 +1000)]
evdev: drop unused enum value DISPATCH_LID_SWITCH
Obsolete since
f0f632649066c4fc92ec3178b9da747758cb7bb8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 11 Sep 2017 00:32:42 +0000 (10:32 +1000)]
tablet: support tablet devices without BTN_TOOL_PEN
Some devices like the UC Logic WP5540U has BTN_STYLUS but not BTN_TOOL_PEN.
While a kernel bug, let's just handle these correctly anyway.
https://bugs.freedesktop.org/show_bug.cgi?id=102570
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Yay-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Thu, 22 Dec 2016 02:11:43 +0000 (12:11 +1000)]
tablet: add a quirk for the HUION PenTablet that doesn't send proximity out events
Could be fixed in the kernel, but these tablets are effectively abandoned and
fixing them is a one-by-one issue. Let's put the infrastructure in place to
have this fixed once for this type of device and move on.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Yay-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Tue, 19 Sep 2017 00:51:32 +0000 (10:51 +1000)]
test: remove leftover sleep() for debugging in lid switch test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 12 Sep 2017 00:09:51 +0000 (10:09 +1000)]
evdev: remove duplicate device name in log message
evdev_log_* already writes the device name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 Sep 2017 04:38:53 +0000 (14:38 +1000)]
touchpad: don't resume a disabled touchpad
A touchpad that was disabled by toggling the sendevents option would come back
normally after a lid resume, despite still being nominally disabled.
https://bugzilla.redhat.com/show_bug.cgi?id=
1448962
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 Sep 2017 04:12:09 +0000 (14:12 +1000)]
tools: add --disable-sendevents option to the debug-events/debug-gui tools
Makes it possible to debug issues with sendevents.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 22 Dec 2016 01:33:19 +0000 (11:33 +1000)]
Add helper function for time to timeval conversion
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 10 Sep 2017 23:43:24 +0000 (09:43 +1000)]
Merge branch 'wip/ignore-moved-touches'
Peter Hutterer [Sun, 10 Sep 2017 23:02:14 +0000 (09:02 +1000)]
Merge branch 'wip/sw-tablet-mode'
Peter Hutterer [Mon, 4 Sep 2017 05:10:58 +0000 (15:10 +1000)]
filter: don't allow an accel factor of 0 on the flat profile
Leave a narrow gap so the mouse moves excruciatingly slow instead of not
moving at all. This allows to recover from overexcited mouse speed slider
movements.
https://bugs.freedesktop.org/show_bug.cgi?id=102501
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 30 Aug 2017 05:53:01 +0000 (15:53 +1000)]
udev: move the EKR into the parent's device group
If we find an EKR, search for the usb hub of the Cintiq, then find the Cintiq
Pen (or Touch) device and assume that device's product id. This way we end up
in the same device group as the Cintiq.
Co-authored-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 30 Aug 2017 05:52:41 +0000 (15:52 +1000)]
util: add a safe_atoi_base() function
For parsing hex numbers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 1 Sep 2017 07:30:08 +0000 (17:30 +1000)]
touchpad: if a device has a tablet mode switch, disable the touchpad
On some devices with a tablet mode switch, the touchpad is inacessible when
in tablet mode and we don't really need this except to avoid possible ghost
touches (none have been mentioned so far). On other devices like the Lenovo
Yoga, the touchpad points to the back of the device and it's hard to use the
device without accidentally using the touchpad. For those, disabling the
touchpad is the best solution.
https://bugs.freedesktop.org/show_bug.cgi?id=102408
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 21 Apr 2017 07:52:37 +0000 (17:52 +1000)]
Add support for SW_TABLET_MODE
https://bugs.freedesktop.org/show_bug.cgi?id=101008
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 Sep 2017 00:40:04 +0000 (10:40 +1000)]
evdev: move lid code to the fallback interface
This was originally designed to deal with devices that only have SW_LID. But
it can be moved into the evdev interface to avoid duplication once we have
SW_TABLET_MODE. The original assumption of the lid switch device being a
standalone device with no other switches is not true, having a separate
dispatch hurts us here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 Sep 2017 04:03:28 +0000 (14:03 +1000)]
tools: remove a leftover debug printf statement
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 21 Apr 2017 06:57:39 +0000 (16:57 +1000)]
Add libinput_device_switch_has_switch()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 21 Apr 2017 07:31:49 +0000 (17:31 +1000)]
test: make some of the switch tests more generic
Still hardcoded for lid switches, but easier to change for other switches now.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 23 Apr 2017 22:22:08 +0000 (08:22 +1000)]
test: add test for switch capability
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 21 Apr 2017 07:27:27 +0000 (17:27 +1000)]
test: rename 'sw' to 'dev' for the lid tests
More in line with other tests and allows us to use 'sw' as name for the actual
switch to be toggled later. The variable name 'sw' stays in those tests where
we have touchpad/keyboard/etc. devices as well.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 Sep 2017 00:33:23 +0000 (10:33 +1000)]
evdev: remove declarations for two nonexistent functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 Sep 2017 05:07:05 +0000 (15:07 +1000)]
tools: restore option handling for the debug gui
window_init zeroes out the struct and loses any option parsing done before.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 1 Sep 2017 07:28:33 +0000 (17:28 +1000)]
evdev: remove unused argument from evdev_tag_lid_switch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 1 Sep 2017 07:08:17 +0000 (17:08 +1000)]
touchpad: rename the lid_switch_listener to just listener
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 21 Apr 2017 06:33:02 +0000 (16:33 +1000)]
test: make the lid action helper function a generic switch action helper
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 21 Apr 2017 02:05:33 +0000 (12:05 +1000)]
test: rename test-lid.c to test-switch.c
So we can add other switch tests to it without confusing too many people.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 21 Jun 2017 02:29:52 +0000 (12:29 +1000)]
touchpad: use motion speed to ignore accidental 2fg touches
Calculate the speed of the touch and compare it against a fixed speed limit.
If a touch exceeds the speed when a second touch is set down, that second
touch is marked as a thumb and ignored (unless it's right next to the other
finger, then it's likely a 2fg scroll).
The speed calculation is simple but has to lag behind by one sample - we reset
the motion history whenever a new finger is set down (to avoid pointer jumps)
so we need to know if the finger was moving fast *before* this happens. Plus,
with the pointer jumps we're more likely to get false positives if we
calculate the speed on actual finger down.
This is the simplest version for now, the speed varies greatly between
movements and should probably be averaged across the last 3-or-so samples.
https://bugs.freedesktop.org/show_bug.cgi?id=99703
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 21 Jun 2017 01:16:27 +0000 (11:16 +1000)]
touchpad: store the time in the motion history
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 30 Aug 2017 04:00:09 +0000 (14:00 +1000)]
touchpad: ignore thumbs during edge scrolling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 30 Aug 2017 04:49:05 +0000 (14:49 +1000)]
test: fix the litest_touch_move_to() step counter
We were undercounting by one, causing a slight jump by (step-distance * 2) on
the last event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 30 Aug 2017 03:49:32 +0000 (13:49 +1000)]
test: fix indentation for palm touch size test
Somehow this ended up being spaces instead of tabs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 28 Aug 2017 02:03:54 +0000 (12:03 +1000)]
test: add a test for removing a touch device with a finger still down
https://bugs.freedesktop.org/show_bug.cgi?id=102385
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 17 Aug 2017 19:32:02 +0000 (05:32 +1000)]
evdev: accept accelerometers if they are tagged as other devices too
Devices tagged as accelerometers may also be other devices like tablet pads.
Only ignore pure accelerometer devices but disable the accelerometer axes for
devices that have multiple types.
https://bugs.freedesktop.org/show_bug.cgi?id=102100
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Peter Hutterer [Sun, 27 Aug 2017 23:16:53 +0000 (09:16 +1000)]
test: fix pad ring test for small pad ranges
The current tests worked because all rings had the same range, so our error
margin covered for that. With the upcoming MobileStudio Pro 16 pad device, the
range is half and our error margins don't work anymore. Switch to a more
reliable approach that tests every integer value the wheel can send, even
though it relies on kernel filtering.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 16 Aug 2017 23:25:24 +0000 (01:25 +0200)]
Add support for LIBINPUT_IGNORE_DEVICE
The recommended way to have libinput ignore specific devices so far was to
remove the ID_INPUT* properties from the device. That may also affect other
pieces of the stack that need access to this device.
For the niche case of a device that should only be ignored by libinput but
otherwise be treated normally by the system, we now support the
LIBINPUT_IGNORE_DEVICE property.
If the property is set to "0", it's equivalent to being unset. This gets
around some technical limitations in udev where unsetting a property is
impossible via a hwdb entry.
https://bugs.freedesktop.org/show_bug.cgi?id=102229
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 17 Aug 2017 00:07:18 +0000 (02:07 +0200)]
test: expose litest_create() to test cases
And make it init the full litest device minus the libinput device. This
enables us to add litest devices that aren't handled by libinput.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 21 Aug 2017 01:41:19 +0000 (11:41 +1000)]
udev: update pressure range for Dell Latitude E6620
"This gives some more sensitivity to the fingers without introducing spurious
touches and movements."
https://bugs.freedesktop.org/show_bug.cgi?id=101670
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Philip Withnall [Fri, 18 Aug 2017 08:13:33 +0000 (09:13 +0100)]
build: Add -Iinclude to unit tests
It seems the unit tests rely on another part of <linux/input.h> which I
missed in the previous commit (
5cf4b35b).
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Philip Withnall [Tue, 15 Aug 2017 14:42:48 +0000 (15:42 +0100)]
build: Add -Iinclude to libinput and its tools
Various files use #include <linux/input.h> and, if the system input.h is
too old, will fail to compile. Use the internal copy by adding -Iinclude
to the build command lines. This was the case in the old autotools build
system.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 17 Aug 2017 00:02:56 +0000 (02:02 +0200)]
test: fix typo in test case name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 16 Aug 2017 23:28:52 +0000 (01:28 +0200)]
test: when restoring the log handler to defaults, also restore log priority
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Ronald Tschalär [Fri, 4 Aug 2017 21:38:38 +0000 (14:38 -0700)]
touchpad: Allow larger palm sizes.
On MBP13,3 the touch areas are quite large, and a thumb size easily gets
to 1000+. Hence need to be able to set palm sizes > 1024 (using 1200
currently).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 3 Aug 2017 16:39:46 +0000 (17:39 +0100)]
evdev: disable evdev event debugging again
This snuck in with
432fbc33cd6a2181ac213eeb66239df8312836a6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Sun, 2 Jul 2017 14:35:36 +0000 (16:35 +0200)]
touchpad: Enable timestamp smoothing support for bluetooth touchpads
Bluetooth wreaks havoc with the timestamp of the input events coming
from the touchpad, enable timestamp smoothing support to counter this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Sun, 2 Jul 2017 14:35:35 +0000 (16:35 +0200)]
filter: Add timestamp smoothing support
Some devices, specifically some bluetooth touchpads generate quite
unreliable timestamps for their events. The problem seems to be that
(some of) these touchpads sample at aprox 90 Hz, but the bluetooth stack
only communicates about every 30 ms (*) and then sends mutiple HID input
reports in one batch.
This results in 2-4 packets / SYNs every 30 ms. With timestamps really
close together. The finger coordinate deltas in these packets change by
aprox. the same amount between each packet when moving a finger at
constant speed. But the time deltas are e.g. 28 ms, 1 ms, 1 ms resulting
in calculate_tracker_velocity returning vastly different speeds for the
1st and 2nd packet, which in turn results in very "jerky" mouse pointer
movement.
*) Maybe it is waiting for a transmit time slot or some such.
This commit adds support for a real simple timestamp smoothing algorithm,
intended *only* for use with touchpads. Since touchpads will send a
contineous stream of events at their sample rate when a finger is down,
this filter simply assumes that any events which are under
event_delta_smooth_threshold us apart are part of a smooth continuous
stream of events with each event being event_delta_smooth_value us apart.
Theoritically a very still finger may send the exact same coordinates
and pressure twice, but even if this happens that is not a problem because
a still finger generates coordinates changes below the hyst treshold so
we ignore it anyways.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jul 2017 12:59:40 +0000 (13:59 +0100)]
gestures: don't try to pinch for nfingers > slots
We don't know the position of the third finger on 2-slot touchpads, differing
between swipe and pinch is reliable. Simply disable 3-finger pinch and always
use swipe; 3fg pinch is uncommon anyway and it's better to have one of the
gestures working reliably than both unreliably.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 24 Jul 2017 23:38:46 +0000 (09:38 +1000)]
lid: disable all types but EV_SYN and EV_SW
The lid dispatch interface is a one-trick pony and can only handle SW_LID. It
ignores other switches but crashes on any event type other than EV_SW and
EV_SYN. Disable those types so we just ignore the event instead of asserting.
https://bugs.freedesktop.org/show_bug.cgi?id=101853
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Peter Hutterer [Fri, 14 Jul 2017 03:42:53 +0000 (13:42 +1000)]
pointer: add button debouncing
Some devices have worn-out switches or just cheap switches that trigger
multiple button events for each press. These can be identified by unfeasably
short time deltas between the release and the next press event. In the
recordings I've seen so far, that timeout is 8ms.
We have a two-stage behavior: by default, we do not delay any events but we
monitor timestamps. The first time a bouncing button is detected we switch to
debounce mode. From then on, release events are delayed slightly to check for
subsequent button events. If one occurs, the releas and press are filtered. If
none occurs, the release event is passed to the caller.
https://bugs.freedesktop.org/show_bug.cgi?id=100057
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 17 Jul 2017 02:30:25 +0000 (12:30 +1000)]
timer: always restart the timer loop when we called one of them
If a timer_func causes the removal or addition of a different timer, our tmp
pointer from the list_for_each_safe may not be valid anymore.
This was triggered by having the debounce code trigger a middle button state
change, which caused that timer to be cancelled.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 17 Jul 2017 01:58:11 +0000 (11:58 +1000)]
timer: if a timer is inactive, do not call the timer func
Race conditions may happen where code that cancels a timer is called just
as that timer triggers. If we cancel a timer, we assume that we've put the
code into a state where the timer firing will trigger a bug.
This could be observed with the middle button code if the release event was
held back just long enough. The button release code cancelled the timer, set
the state back to idle and then complained when the timeout handling sent a
'timeout' event while being in idle.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 18 Jul 2017 06:12:27 +0000 (16:12 +1000)]
evdev: recover from a lost button count
If the kernel sends us a button press for a button that is thought to be down
we have lost track of the state of the button. Ignore the button press event,
in the hope that the next release makes things right again.
A release event may be masked if another process grabs the device for some
period of time, e.g. libinput debug-events --grab.
https://bugs.freedesktop.org/show_bug.cgi?id=101796
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 20 Jul 2017 03:33:43 +0000 (13:33 +1000)]
Merge branch 'wip/trackpoint-accel-v6'
Peter Hutterer [Tue, 16 May 2017 03:10:07 +0000 (13:10 +1000)]
trackpoint: parse a trackpoint range property
Add parsing for a LIBINPUT_ATTR_TRACKPOINT_RANGE property to enable
hardware-dependent ranges. These take precedence over the sensitivity parsing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 16 May 2017 03:01:32 +0000 (13:01 +1000)]
trackpoint: drop handling of CONST_ACCEL and undo SENSITIVITY
This was to counteract hardware that doesn't work well out of the box,
resulting in quite different behavior across devices. Specifically, only
some trackpoints even have the sensitivity setting.
Change to take over all of the pointer acceleration on trackpoints, so we can
control the actual behavior mostly independent of the system setting. So we
drop the CONST_ACCEL parsing (which never was handled as const accel anyway)
and undo the effect that the SENSITIVITY udev property has. [1]
We take a default range at the default sensitivity and multiply it by the
proportion of the current sensitivity. This seems to be accurate enough.
[1] In the future, we should read not only the property but also the sysfs file to
make sure we're handling the right value, but for now this will do.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 12 May 2017 04:39:24 +0000 (14:39 +1000)]
filter: add a custom trackpoint accelerator
Switch to a pure factor with a max scaled after a function. The offset is just
0 now (will be removed eventually). Both are determined with a function based
on a linear/exponential regression of a sample set of data pairs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 11 May 2017 07:17:54 +0000 (17:17 +1000)]
tools: add a command to analyze trackpoints
Trackpoints can send very different ranges between the various pressures.
Collect the data and print it out to get an idea of what ranges are realistic.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 30 Jun 2017 10:35:56 +0000 (20:35 +1000)]
test: drop an unnecessary wait for event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 14 Jul 2017 03:47:29 +0000 (13:47 +1000)]
Merge branch 'wip/touchpad-apple-touch-major-v2'
Peter Hutterer [Wed, 12 Jul 2017 04:56:01 +0000 (14:56 +1000)]
tools: add an extra linebreak in the tap measuring tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 12 Jul 2017 04:41:24 +0000 (14:41 +1000)]
test: silence a coverity warning
Value set but overwritten before use.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 6 Jul 2017 23:47:06 +0000 (09:47 +1000)]
Add safe_strdup()
Return value is either NULL or a strdup'd string, depending on the input
value.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 7 Jul 2017 01:18:40 +0000 (11:18 +1000)]
Replace calloc calls with zalloc
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 6 Jul 2017 23:42:59 +0000 (09:42 +1000)]
Abort if zalloc ever fails
There's no guarantee that libinput does the right thing if memory allocation
fails and it's such a niche case on the systems we're targeting that it just
doesn't matter. Simply abort if zalloc ever fails.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 12 Jul 2017 00:16:47 +0000 (10:16 +1000)]
doc: add a line break
doxygen ends the @bug command when a new section command (@code) is
encountered, leaving us with an "Example code:" on the Bug List page.
Add an empty line to cut off here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jul 2017 08:50:52 +0000 (18:50 +1000)]
tools: add a tool to measure touch size and orientation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 23 Mar 2017 04:54:00 +0000 (14:54 +1000)]
touchpad: add touch-size-based palm detection
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 22 Mar 2017 06:16:21 +0000 (16:16 +1000)]
touchpad: add touch-size based touch handling
Apple touchpads don't use ABS_MT_PRESSURE but they are multitouch touchpads,
so the current pressure-based handling code doesn't apply because it expects
slot-based pressure for mt touchpads.
Apple does however send useful data for ABS_MT_WIDTH_MAJOR/MINOR, so let's use
that instead. The data provided in those is more-or-less random, so we need a
hwdb entry to track the acceptable thresholds.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jul 2017 06:25:40 +0000 (16:25 +1000)]
util: rename the pressure range parser to a more generic range_parser
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 29 Mar 2017 02:31:12 +0000 (12:31 +1000)]
test: loosen up litest to allow major/minor handling
The max values on ABS_MT_TOUCH_MAJOR/MINOR aren't hard limits, they basically
represent the size of a finger with (afaict) a suggestion that anything
greater than the max may be a palm. Disable the 0-100% range checks for those
axes so we can send custom events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 28 Mar 2017 01:22:27 +0000 (11:22 +1000)]
test: force-release major/minor on the default touch up
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 11 Jul 2017 01:41:15 +0000 (11:41 +1000)]
touchpad: set keyboard to non-active when the keyboard is removed
If the keyboard is removed while dwt thinks it is in active state, that state
is never reset and subsequent touches are ignored.
https://bugs.freedesktop.org/show_bug.cgi?id=101743
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 3 Jul 2017 01:28:18 +0000 (11:28 +1000)]
timer: add a timer name to each timer
So we have something useful to print when we trigger an error in the timer
code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 3 Jul 2017 02:45:12 +0000 (12:45 +1000)]
util: drop an unnecessary declaration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jul 2017 02:34:40 +0000 (12:34 +1000)]
Add support for CircleCI
This isn't currently hooked up to the fdo repo but it's hooked up to my
github mirror. I had SemaphoreCI hooked up to that before but it only
supports ubuntu 14.04 and the recent meson switch made it a bit hard to setup.
CircleCI supports running docker containers, so let's do that and run against
the most recent released Fedora and a recent Ubuntu. I'm not bothering with
rawhide, it's likely to increase the work for little gain when it's in a
semi-broken state.
Run the default build with a few permutations to test meson options. Run
scan-build too but that's just for the logs, eventually this may turn into a
hard failure.
Ubuntu 17.04's meson is too old, so we have to clone that from git. Install
arguments are taken from the meson.deb package.
Most of this effort was done by Benjamin Tissoires.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Benjamin Tissoires <benjamin.tissoires@gmail.com>