platform/upstream/libinput.git
7 years agocircle.yml: add ninja dist to tests
Peter Hutterer [Wed, 1 Nov 2017 01:19:08 +0000 (11:19 +1000)]
circle.yml: add ninja dist to tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: if we don't have a uinput device node, skip the test suite
Peter Hutterer [Wed, 1 Nov 2017 04:19:21 +0000 (14:19 +1000)]
test: if we don't have a uinput device node, skip the test suite

When running ninja dist in a container, we cannot create devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: mkdir -p the udev rules and hwdb directories
Peter Hutterer [Wed, 1 Nov 2017 04:12:01 +0000 (14:12 +1000)]
test: mkdir -p the udev rules and hwdb directories

Especially /run/udev/rules.d may not exist, causing a test suite failure.

https://bugs.freedesktop.org/show_bug.cgi?id=103527

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: allow for multiple paired keyboards
Peter Hutterer [Mon, 23 Oct 2017 04:34:47 +0000 (14:34 +1000)]
touchpad: allow for multiple paired keyboards

needed for the razer blade keybard which provides multiple event nodes for
one physical device but it's hard/impossible to identify which one is the real
event node we care about.

https://bugs.freedesktop.org/show_bug.cgi?id=103156

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolibinput 1.9.1 1.9.1
Peter Hutterer [Mon, 30 Oct 2017 04:58:05 +0000 (14:58 +1000)]
libinput 1.9.1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agofallback: fix lid switch event listener being initialized twice
Peter Hutterer [Fri, 27 Oct 2017 05:03:52 +0000 (15:03 +1000)]
fallback: fix lid switch event listener being initialized twice

Once the lid is closed, the keyboard event listener is set up to open the lid
for us on keyboard events. With the right sequence, we can trigger the
listener to be added to the list multiple times, triggering an assert in the
list test code (or an infinite loop in the 1.8 branch).

Conditions:
* SW_LID value 1 - sets up the keyboard listener
* keyboard event - sets lid_is_closed to false
* SW_LID value 0 - is ignored because we're already open
* SW_LID value 1 - sets up the keyboard listener again

https://bugs.freedesktop.org/show_bug.cgi?id=103298

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoudev: drop the version field in device groups
Benjamin Tissoires [Thu, 26 Oct 2017 08:17:06 +0000 (10:17 +0200)]
udev: drop the version field in device groups

The version field is a per device information. We have
no guarantees a touchscreen and a tablet device will share
the same version of the firmware (especially if both
firmwares are from different vendors).

Fixes the touch arbitration for the Dell Canvas 27

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agomeson: require GTK 3.20
Peter Hutterer [Thu, 26 Oct 2017 06:45:24 +0000 (16:45 +1000)]
meson: require GTK 3.20

For GDK_SEAT_CAPABILITY_ALL_POINTING

https://bugs.freedesktop.org/show_bug.cgi?id=103462

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotablet: print what capability is missing when rejecting a device
Peter Hutterer [Thu, 26 Oct 2017 00:10:04 +0000 (10:10 +1000)]
tablet: print what capability is missing when rejecting a device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: cap the edge palm detection zones at 8mm
Peter Hutterer [Mon, 23 Oct 2017 05:30:41 +0000 (15:30 +1000)]
touchpad: cap the edge palm detection zones at 8mm

The main purpose of the edge zone is to detect palms in the area where we
cannot assume a full finger size and thus cannot use any other palm detection
mechanism. 8mm should be large enough that a finger should be detected based
on other properties (size, pressure, ...).

https://bugs.freedesktop.org/show_bug.cgi?id=103330

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoRevert "touchpad: cap the edge palm detection zones at 8mm"
Peter Hutterer [Wed, 25 Oct 2017 04:18:17 +0000 (14:18 +1000)]
Revert "touchpad: cap the edge palm detection zones at 8mm"

This patch only adjusted the left edge, not the right edge which was still on
8%

This reverts commit 3e9e0e2eb18f0eae5ffe2be756903d92b8b88f75.

7 years agotouchpad: cap the edge palm detection zones at 8mm
Peter Hutterer [Mon, 23 Oct 2017 05:30:41 +0000 (15:30 +1000)]
touchpad: cap the edge palm detection zones at 8mm

The main purpose of the edge zone is to detect palms in the area where we
cannot assume a full finger size and thus cannot use any other palm detection
mechanism. 8mm should be large enough that a finger should be detected based
on other properties (size, pressure, ...).

https://bugs.freedesktop.org/show_bug.cgi?id=103330

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
7 years agotest: add a wacom bamboo test device
Peter Hutterer [Fri, 20 Oct 2017 00:39:37 +0000 (10:39 +1000)]
test: add a wacom bamboo test device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: fix missing BTN_9 for the MobileStudio device
Peter Hutterer [Fri, 20 Oct 2017 04:58:25 +0000 (14:58 +1000)]
test: fix missing BTN_9 for the MobileStudio device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: fix pid for the 13HDT pad
Peter Hutterer [Fri, 20 Oct 2017 04:55:24 +0000 (14:55 +1000)]
test: fix pid for the 13HDT pad

7 years agolibinput 1.9.0 1.9.0
Peter Hutterer [Thu, 19 Oct 2017 03:40:15 +0000 (13:40 +1000)]
libinput 1.9.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotouchpad: cut down on excessive logging for palm size
Peter Hutterer [Thu, 19 Oct 2017 02:14:47 +0000 (12:14 +1000)]
touchpad: cut down on excessive logging for palm size

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoutil: add an extra assert for list_insert()
Peter Hutterer [Wed, 18 Oct 2017 05:24:03 +0000 (15:24 +1000)]
util: add an extra assert for list_insert()

If we're adding an element that's not null or not a freshly initialized list,
chances are we haven't removed it from a previous list.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
7 years agotest: unref the litest device *after* removing it from the path interface
Peter Hutterer [Tue, 17 Oct 2017 06:55:27 +0000 (16:55 +1000)]
test: unref the litest device *after* removing it from the path interface

Our own reference may be the last one that's still alive if the context is
currently suspended (litest_suspend()). If we unref before removing it from
the path interface, we access already freed memory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
7 years agotest: fix a comment in the log_priority test
Peter Hutterer [Tue, 10 Oct 2017 09:09:29 +0000 (19:09 +1000)]
test: fix a comment in the log_priority test

We don't rely that the lid switch doesn't work in this test, but we always
print a few things when a device gets successfully added.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolibinput 1.8.902 1.8.902
Peter Hutterer [Tue, 10 Oct 2017 02:15:35 +0000 (12:15 +1000)]
libinput 1.8.902

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoFix meson options default values
Peter Hutterer [Mon, 9 Oct 2017 22:04:35 +0000 (08:04 +1000)]
Fix meson options default values

The keyword is 'value', not 'default'. With meson 0.43 this now stops
building.

https://bugs.freedesktop.org/show_bug.cgi?id=103162

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotools: restore default permissions for a source file
Peter Hutterer [Mon, 9 Oct 2017 03:18:53 +0000 (13:18 +1000)]
tools: restore default permissions for a source file

This was accidentally made 755 as part of e9fc59efc853

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoevdev: fix a coverity warning
Peter Hutterer [Mon, 9 Oct 2017 01:27:06 +0000 (11:27 +1000)]
evdev: fix a coverity warning

'rc' is possibly unused

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: always init the log_handler count and reset it last
Peter Hutterer [Fri, 6 Oct 2017 00:41:08 +0000 (10:41 +1000)]
test: always init the log_handler count and reset it last

When running with -j 1 and CK_FORK=no, the log_handler_count is shared between
the tests. The log_priority tests can invoke the log handler during
libinput_unref(), so on the next day the log handler starts with a nonzero log
handler.

Fix this by always initializing it to 0 in the tests we expect it to be zero
and resetting it last.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: add a section for tablet mode switches
Peter Hutterer [Wed, 27 Sep 2017 22:57:37 +0000 (08:57 +1000)]
doc: add a section for tablet mode switches

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: add another item to the FAQ
Peter Hutterer [Wed, 27 Sep 2017 22:47:10 +0000 (08:47 +1000)]
doc: add another item to the FAQ

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: update the GNOME stack graph
Peter Hutterer [Wed, 27 Sep 2017 22:43:38 +0000 (08:43 +1000)]
doc: update the GNOME stack graph

These days it's mutter that controls the input devices, not g-s-d.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agolibinput 1.8.901 1.8.901
Peter Hutterer [Wed, 27 Sep 2017 03:55:07 +0000 (13:55 +1000)]
libinput 1.8.901

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotest: if we're not root, return with status 77
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>
7 years agofallback: suspend internal keyboards and trackpoints on tablet-mode switch
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>
7 years agofallback: add 'interface' to the fallback interface's method names
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>
7 years agotouchpad: invert an if condition to allow for early return
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>
7 years agofallback: move the fallback code into a separate file
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>
7 years agoevdev: rename evdev_key_type to just key_type
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>
7 years agoevdev: abstract the get_switch_state method
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>
7 years agoUse named initializers for the various dispatch interfaces
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>
7 years agoevdev: change prefix on some fallback-only methods
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>
7 years agoMerge branch 'wip/litest-use-sections-for-tests-v2'
Peter Hutterer [Mon, 25 Sep 2017 04:35:46 +0000 (14:35 +1000)]
Merge branch 'wip/litest-use-sections-for-tests-v2'

7 years agofallback: allow for multiple keyboards to toggle the lid switch
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>
7 years agotest: fix test listing
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>
7 years agotest: fix no-device test name handling
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>
7 years agotest: fix test listing
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>
7 years agotest: fix no-device test name handling
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>
7 years agotest: switch to a TEST_DEVICE macro for all the litest test devices
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>
7 years agotest: add missing newline to an error message
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>
7 years agotest: drop obsolete semi-mt allocation for the atmel hover device
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>
7 years agotest: fix the 'all codes' keyboard device
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>
7 years agotimer: flush the timer funcs if our events come in late
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>
7 years agotablet: always enable the no-proximity-out quirk on HUION tablets
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>
7 years agoevdev: update key type check for new key defines
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>
7 years agoinclude: sync linux kernel header files with 4.12
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>
7 years agoevdev: add a comment to the toggle_touch interface
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>
7 years agoevdev: drop unused #define DEFAULT_TRACKPOINT_ACCEL
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>
7 years agoevdev: drop unused enum value DISPATCH_LID_SWITCH
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>
7 years agotablet: support tablet devices without BTN_TOOL_PEN
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>
7 years agotablet: add a quirk for the HUION PenTablet that doesn't send proximity out events
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>
7 years agotest: remove leftover sleep() for debugging in lid switch test
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>
7 years agoevdev: remove duplicate device name in log message
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>
7 years agotouchpad: don't resume a disabled touchpad
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>
7 years agotools: add --disable-sendevents option to the debug-events/debug-gui tools
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>
7 years agoAdd helper function for time to timeval conversion
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>
7 years agoMerge branch 'wip/ignore-moved-touches'
Peter Hutterer [Sun, 10 Sep 2017 23:43:24 +0000 (09:43 +1000)]
Merge branch 'wip/ignore-moved-touches'

7 years agoMerge branch 'wip/sw-tablet-mode'
Peter Hutterer [Sun, 10 Sep 2017 23:02:14 +0000 (09:02 +1000)]
Merge branch 'wip/sw-tablet-mode'

7 years agofilter: don't allow an accel factor of 0 on the flat profile
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>
7 years agoudev: move the EKR into the parent's device group
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>
7 years agoutil: add a safe_atoi_base() function
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>
7 years agotouchpad: if a device has a tablet mode switch, disable the touchpad
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>
7 years agoAdd support for SW_TABLET_MODE
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>
7 years agoevdev: move lid code to the fallback interface
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>
7 years agotools: remove a leftover debug printf statement
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>
7 years agoAdd libinput_device_switch_has_switch()
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>
7 years agotest: make some of the switch tests more generic
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>
7 years agotest: add test for switch capability
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>
7 years agotest: rename 'sw' to 'dev' for the lid tests
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>
7 years agoevdev: remove declarations for two nonexistent functions
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>
7 years agotools: restore option handling for the debug gui
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>
7 years agoevdev: remove unused argument from evdev_tag_lid_switch
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>
7 years agotouchpad: rename the lid_switch_listener to just listener
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>
7 years agotest: make the lid action helper function a generic switch action helper
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>
7 years agotest: rename test-lid.c to test-switch.c
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>
7 years agotouchpad: use motion speed to ignore accidental 2fg touches
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>
7 years agotouchpad: store the time in the motion history
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>
7 years agotouchpad: ignore thumbs during edge scrolling
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>
7 years agotest: fix the litest_touch_move_to() step counter
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>
7 years agotest: fix indentation for palm touch size test
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>
7 years agotest: add a test for removing a touch device with a finger still down
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>
7 years agoevdev: accept accelerometers if they are tagged as other devices too
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>
7 years agotest: fix pad ring test for small pad ranges
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>
7 years agoAdd support for LIBINPUT_IGNORE_DEVICE
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>
7 years agotest: expose litest_create() to test cases
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>
7 years agoudev: update pressure range for Dell Latitude E6620
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>
7 years agobuild: Add -Iinclude to unit tests
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>
7 years agobuild: Add -Iinclude to libinput and its tools
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>
7 years agotest: fix typo in test case name
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>
7 years agotest: when restoring the log handler to defaults, also restore log priority
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>
7 years agotouchpad: Allow larger palm sizes.
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>
7 years agoevdev: disable evdev event debugging again
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>
7 years agotouchpad: Enable timestamp smoothing support for bluetooth touchpads
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>
7 years agofilter: Add timestamp smoothing support
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>