platform/upstream/libinput.git
8 years agotest: restore the hwdb/udev rules on SIGINT
Peter Hutterer [Tue, 19 Jul 2016 22:45:22 +0000 (08:45 +1000)]
test: restore the hwdb/udev rules on SIGINT

We can't call system() in the signal handler but we are allowed to fork. Do
that, update the hwdb and immediately exit the child again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: make sure we remove all udev rules when we SIGINT the test
Peter Hutterer [Tue, 19 Jul 2016 22:43:05 +0000 (08:43 +1000)]
test: make sure we remove all udev rules when we SIGINT the test

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: only init the device rules once
Peter Hutterer [Thu, 7 Jul 2016 23:42:36 +0000 (09:42 +1000)]
test: only init the device rules once

The udev hwdb takes about 200ms and we still trigger it on each device. The
udev rules don't actually change after compiling, so simply create them
once and remove them after the test run.

For multiple test binaries this needed to be synchronized (which is hard),
hence the previous merge into a single binary for all tests.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: merge all tests into a single binary
Peter Hutterer [Fri, 22 Jul 2016 03:16:49 +0000 (13:16 +1000)]
test: merge all tests into a single binary

Call it a libinput-test-suite-runner, in subsequent patches we'll handle doing
parallel tests ourselves instead of relying on automake features.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: store created udev rules in a list for easier deletion
Peter Hutterer [Fri, 22 Jul 2016 03:23:35 +0000 (13:23 +1000)]
test: store created udev rules in a list for easier deletion

Easier to clean up than knowing all the destination paths we'll install.
Only affects global udev rules so far.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: make the valgrind test an actual dependency of the test run
Peter Hutterer [Fri, 22 Jul 2016 05:27:49 +0000 (15:27 +1000)]
test: make the valgrind test an actual dependency of the test run

With parallel builds the valgrind test run would run at the same time as the
normal run, the test suite isn't designed for that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: use the udev ID_INPUT_TOUCHPAD_INTEGRATION property if available
Peter Hutterer [Tue, 5 Jul 2016 21:59:31 +0000 (07:59 +1000)]
touchpad: use the udev ID_INPUT_TOUCHPAD_INTEGRATION property if available

udev now labels touchpads as "internal" or "external" for us, use that value
where available and only fall back onto our own labelling if it's missing or
unknown.

systemd commit: https://github.com/systemd/systemd/pull/3638

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: add links to the two debugging tools as examples
Peter Hutterer [Mon, 1 Aug 2016 03:39:34 +0000 (13:39 +1000)]
doc: add links to the two debugging tools as examples

These are the simplest examples on how to use libinput and should be enough to
get any potential user started.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: make the interfaces static
Peter Hutterer [Fri, 22 Jul 2016 03:07:38 +0000 (13:07 +1000)]
test: make the interfaces static

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: namespace the bitfield helper tests
Peter Hutterer [Fri, 22 Jul 2016 04:44:54 +0000 (14:44 +1000)]
test: namespace the bitfield helper tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix prefix for the gestures time test
Peter Hutterer [Fri, 22 Jul 2016 05:26:45 +0000 (15:26 +1000)]
test: fix prefix for the gestures time test

No real effect, just for consistency.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoudev: don't overwrite a previously set device group
Peter Hutterer [Wed, 20 Jul 2016 09:55:48 +0000 (19:55 +1000)]
udev: don't overwrite a previously set device group

In some cases a device may need a device group assigned by a custom udev rule
or hwdb entry. Don't overwrite that with our generated one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: change manual calculations of dimensions to helper functions
Peter Hutterer [Fri, 15 Jul 2016 01:31:07 +0000 (11:31 +1000)]
touchpad: change manual calculations of dimensions to helper functions

Wherever we use an absolute size in mm on the touchpad, switch to the new
helper functions. In a few cases we only need one coordinate so just leave the
other one as 0 in those cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: add helper functions to convert between units and mm
Peter Hutterer [Fri, 15 Jul 2016 01:04:04 +0000 (11:04 +1000)]
evdev: add helper functions to convert between units and mm

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: prefix "tablet unknown to libwacom" error with the device name
Peter Hutterer [Thu, 21 Jul 2016 06:11:39 +0000 (16:11 +1000)]
evdev: prefix "tablet unknown to libwacom" error with the device name

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: change the sanity check function to a bool
Peter Hutterer [Tue, 19 Jul 2016 00:16:49 +0000 (10:16 +1000)]
touchpad: change the sanity check function to a bool

And rename to make the return value more obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agotouchpad: change palm detection trigger functions to bools
Peter Hutterer [Tue, 19 Jul 2016 00:05:37 +0000 (10:05 +1000)]
touchpad: change palm detection trigger functions to bools

And rename to make it more obvious what the return value means.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agotouchpad: change clickfinger check distance function to a bool
Peter Hutterer [Tue, 19 Jul 2016 00:03:21 +0000 (10:03 +1000)]
touchpad: change clickfinger check distance function to a bool

And rename to make it more obvious what the return value will mean.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoSwitch a bunch of internal functions from int to bool
Peter Hutterer [Tue, 12 Jul 2016 01:03:03 +0000 (11:03 +1000)]
Switch a bunch of internal functions from int to bool

All these effectively returned bools anyway, switch the signature over to be
less ambiguous.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoChange a few functions that only ever returned 0 to voids
Peter Hutterer [Tue, 12 Jul 2016 21:55:13 +0000 (07:55 +1000)]
Change a few functions that only ever returned 0 to voids

These are internal functions, if we need them to return an error code we can
change that at any time. Meanwhile, if we only ever return 0 anyway we might
as well just make them voids to save on error paths.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoevdev_device_suspend() is a void function
Peter Hutterer [Tue, 12 Jul 2016 21:39:59 +0000 (07:39 +1000)]
evdev_device_suspend() is a void function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agotouchpad: whitespace fix
Peter Hutterer [Mon, 18 Jul 2016 23:27:50 +0000 (09:27 +1000)]
touchpad: whitespace fix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoconfigure.ac: libinput 1.4.0 1.4.0
Peter Hutterer [Mon, 18 Jul 2016 01:17:56 +0000 (11:17 +1000)]
configure.ac: libinput 1.4.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: make one ALPS and the Synaptics i2c test devices Dell touchpads
Peter Hutterer [Mon, 18 Jul 2016 00:08:16 +0000 (10:08 +1000)]
test: make one ALPS and the Synaptics i2c test devices Dell touchpads

The i2c one came from an Dell XPS13. The ALPS one I can't remember but highly
likely they were on Dells and if not, nothing really changes here anyway
because it's not a clickpad and right now only clickpads have dell-specific
behaviour.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: change offset ints to device_coords
Peter Hutterer [Fri, 15 Jul 2016 00:54:05 +0000 (10:54 +1000)]
touchpad: change offset ints to device_coords

No functional changes, just makes the unit more explicit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: constify evdev_device_get_size
Peter Hutterer [Fri, 15 Jul 2016 01:13:06 +0000 (11:13 +1000)]
evdev: constify evdev_device_get_size

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: don't init a horizontal scroll area on touchpads <50mm high
Peter Hutterer [Wed, 13 Jul 2016 01:47:30 +0000 (11:47 +1000)]
touchpad: don't init a horizontal scroll area on touchpads <50mm high

We simply don't have enough space on those touchpads to have an area carved
out for horizontal scrolling. Given that horizontal scrolling is rarely needed
anyway users of these touchpads will just have to cling to scroll bars or use
two-finger scrolling.

Exception are small clickpads because they already have an area blocked off
for software buttons and those small clickpads generally come from a time when
clickfinger wasn't much of a thing yet.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: split edge scroll tests into one for vert, one for horiz
Peter Hutterer [Thu, 14 Jul 2016 23:17:28 +0000 (09:17 +1000)]
test: split edge scroll tests into one for vert, one for horiz

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: reduce middle button size on Dell touchpads to 10mm
Peter Hutterer [Thu, 30 Jun 2016 00:11:17 +0000 (10:11 +1000)]
touchpad: reduce middle button size on Dell touchpads to 10mm

All Dell touchpas appear to have a visual marker on their touchpads. With a
visible marker our middle button can (and should) be much smaller since we
can rely on users to hit the button precisely.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: drop unused argument diagonal from tp_init_accel
Peter Hutterer [Wed, 13 Jul 2016 01:43:12 +0000 (11:43 +1000)]
touchpad: drop unused argument diagonal from tp_init_accel

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: catch potential segfault if the filter fails to allocate
Peter Hutterer [Tue, 12 Jul 2016 21:54:07 +0000 (07:54 +1000)]
tablet: catch potential segfault if the filter fails to allocate

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoFix some indentation issues
Peter Hutterer [Tue, 12 Jul 2016 21:30:40 +0000 (07:30 +1000)]
Fix some indentation issues

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: add a Cintiq 13 HDT test device
Peter Hutterer [Tue, 12 Jul 2016 04:25:23 +0000 (14:25 +1000)]
test: add a Cintiq 13 HDT test device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoconfigure.ac: libinput 1.4rc1 1.3.901
Peter Hutterer [Tue, 12 Jul 2016 00:37:30 +0000 (10:37 +1000)]
configure.ac: libinput 1.4rc1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoRemove LIBINPUT_EVENT_TABLET_PAD_MODE event
Peter Hutterer [Fri, 8 Jul 2016 00:35:03 +0000 (10:35 +1000)]
Remove LIBINPUT_EVENT_TABLET_PAD_MODE event

Unimplemented and it wasn't supposed to be in the series.

https://lists.freedesktop.org/archives/wayland-devel/2016-June/029376.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agoFix and improve mode group documentation
Peter Hutterer [Fri, 8 Jul 2016 03:09:50 +0000 (13:09 +1000)]
Fix and improve mode group documentation

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: write the valgrind test results to a different output file
Peter Hutterer [Tue, 5 Jul 2016 22:28:09 +0000 (08:28 +1000)]
test: write the valgrind test results to a different output file

Otherwise we overwriting the output from the normal test run.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: up the timeout to 30s
Peter Hutterer [Tue, 5 Jul 2016 00:24:27 +0000 (10:24 +1000)]
test: up the timeout to 30s

10s is not enough when running the test suite in parallel as any test may have
to wait longer than that to get access to the udev lock. Especially for
tests with multiple timeouts it was too easy to trigger timeouts.

Up the timeout to 30s, this seems reliable enough now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
8 years agotest: create a lock file to avoid parallel udev reloads during device add
Peter Hutterer [Mon, 4 Jul 2016 23:41:51 +0000 (09:41 +1000)]
test: create a lock file to avoid parallel udev reloads during device add

litest_add_device and litest_delete_device trigger a udev rule reload. This
messes with some test devices and when we run multiple tests in parallel we
get weird errors like "keyboard $BLAH failed the touchpad sanity test".

Still not 100% reliable to run tests in parallel, but it's vastly improved
now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
8 years agotest: fix a memleak when creating udev devices
Peter Hutterer [Mon, 4 Jul 2016 08:52:19 +0000 (18:52 +1000)]
test: fix a memleak when creating udev devices

If the first device we got didn't have the expected syspath we'd leak the
device and cause the valgrind tests to fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoMerge branch 'wip/tablet-pad-modes-v3'
Peter Hutterer [Mon, 4 Jul 2016 00:26:03 +0000 (10:26 +1000)]
Merge branch 'wip/tablet-pad-modes-v3'

8 years agotouchpad: remove software middle button when emulation is enabled
Peter Hutterer [Thu, 30 Jun 2016 05:49:40 +0000 (15:49 +1000)]
touchpad: remove software middle button when emulation is enabled

Expose the middle button emulation on software buttons as proper config
option. When enabled, remove the middle button software button area.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: return the desired middle button emulation state
Peter Hutterer [Thu, 30 Jun 2016 06:10:14 +0000 (16:10 +1000)]
evdev: return the desired middle button emulation state

Middle button emulation may be delayed in turning on, but during that delay we
already need to return the desired state.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: unify internal/external touchpad tagging
Peter Hutterer [Thu, 30 Jun 2016 02:05:35 +0000 (12:05 +1000)]
touchpad: unify internal/external touchpad tagging

To unify this we need to move the tagging process forward so tp_init() can
rely on it for config setup. This means moving it to the touchpad init code.
Other than that no real functional changes, the rules stay the same:
* serial/i2c/etc. are considered internal touchpads
* Bluetooth is always external
* USB is external for Logitech devices
* USB is external for Wacom devices
* USB is internal for Apple touchpads

And if we can't figure it out, we assume it's external and log a message so we
can put a quirk in place.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogestures: make the gesture movement threshold depending on finger count
Peter Hutterer [Wed, 29 Jun 2016 00:03:23 +0000 (10:03 +1000)]
gestures: make the gesture movement threshold depending on finger count

Increase the mm move threshold for 3 and 4 finger gestures to 2 and 3 mm,
respectively. In multi-finger gestures it's common to have minor movement
while all fingers are being put down or before the conscious movement starts.
This can trigger invalid gesture detection (e.g. a pinch instead of a swipe).
Increase the movement threshold to make sure we have sufficient input data.

No changes to 2-finger movements.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agogitignore: add pattern for gcov detritus
Peter Hutterer [Wed, 29 Jun 2016 05:15:50 +0000 (15:15 +1000)]
gitignore: add pattern for gcov detritus

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: add a section to the FAQ on how to retrigger hwdb changes
Peter Hutterer [Wed, 29 Jun 2016 05:18:25 +0000 (15:18 +1000)]
doc: add a section to the FAQ on how to retrigger hwdb changes

I'm typing this way too often into bugreports

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: only check for vertical finger distribution on 2fg gestures
Peter Hutterer [Tue, 28 Jun 2016 05:25:42 +0000 (15:25 +1000)]
touchpad: only check for vertical finger distribution on 2fg gestures

A natural hand position for a 4-finger swipe will have one finger well below
the other triggering the pinch detection. This is obviously wrong, only do the
finger position analysis when we have 2 fingers.

This is only a partial fix, for 3-4 finger gestures chances are high that the
third/fourth finger come in a different event frame. Before that we likely
detect 2 fingers in a possible pinch position and still trigger the code path.
This issue has to be fixed separately.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: make the cursor/lens tool behave like a 1000dpi mouse
Peter Hutterer [Tue, 21 Jun 2016 05:20:08 +0000 (15:20 +1000)]
tablet: make the cursor/lens tool behave like a 1000dpi mouse

The current code tried to emulate the relative motion to be equivalent to the
absolute motion, except in screen coordinates. This is way too slow for the
cursor tool that we want to behave like a mouse.

Tablets have high resolution (e.g. an Intuos 4 is a 5080dpi mouse) and that
motion is way too fast to be usable. Scale it down to match a 1000dpi device
instead. Since the cursor and lens tool are still high precision devices leave
them in a flat acceleration profile without actual acceleration.

For the stylus-like devices leave the current accel, pointer acceleration on a
stylus is hard to handle.

This also adds the missing bits for actually using the speed factor set
through the config interface.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agotools: reduce tilt scale to 1/30 of the input value
Peter Hutterer [Mon, 27 Jun 2016 01:33:49 +0000 (11:33 +1000)]
tools: reduce tilt scale to 1/30 of the input value

The x/y tilt angle comes in as degrees, so our scale could be as large as 90x
the original size. Scale to something more sensible.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: add pad mode group tests
Peter Hutterer [Mon, 6 Jun 2016 04:01:02 +0000 (14:01 +1000)]
test: add pad mode group tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agotest: add an Wacom EKR test device
Peter Hutterer [Tue, 7 Jun 2016 23:49:17 +0000 (09:49 +1000)]
test: add an Wacom EKR test device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agopad: implement basic mode group support (1 group with 1 mode)
Peter Hutterer [Thu, 2 Jun 2016 05:35:43 +0000 (15:35 +1000)]
pad: implement basic mode group support (1 group with 1 mode)

Until the kernel patches to handle LED group switching are in place we provide
the external API backed by an implementation that simply exposes one group
with one mode and no toggle buttons. This allows us to ship a libinput release
with the API in place and switch libinput later without having all the stack
above us being delayed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agopad: Add a new API for modes and mode groups
Peter Hutterer [Thu, 26 May 2016 00:05:10 +0000 (10:05 +1000)]
pad: Add a new API for modes and mode groups

Move mode control to libinput. This reduces some flexibility on what we can do
with modes but makes it a lot easier for anyone to implement modes correctly
and have the LEDs apply appropriately, etc. Let's go with the option to make
the 95% use-case easy. Note: whether the mode is actually used is up to the
caller, e.g.  under Windows and OS X the mode only applies to the
rings/strips, not the buttons.

A tablet pad has 1 or more mode groups, all buttons/ring/strips are assigned
to a mode group. That group has a numeric mode index and is hooked to the
LEDs. libinput will switch the LEDs accordingly.

The mode group is a separate object. This allows for better APIs when it comes
to:
* checking whether a button/ring/strip is part of a mode group
* checking whether a button will trigger a mode transition

and in the future potentially:
* checking which mode transition will happen
* setting which button should change the mode transition
* changing what type of mode transition should happen.
* moving a button from one mode group to the other

This patch adds the basic scaffolding, without any real implementation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Proofread-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agodoc: add two svgs showing the modes
Peter Hutterer [Wed, 25 May 2016 23:59:19 +0000 (09:59 +1000)]
doc: add two svgs showing the modes

Separate patch to avoid crowding out the actual content in the patch with the
documentation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agodoc: move the struct declarations to the top
Peter Hutterer [Thu, 2 Jun 2016 04:12:26 +0000 (14:12 +1000)]
doc: move the struct declarations to the top

They don't define anything, move them to the top so we don't have ordering
requirements of the stuff that actually uses those as parameters.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agodoc: split the tablet pad events into their own doxygen module page
Peter Hutterer [Thu, 2 Jun 2016 03:07:17 +0000 (13:07 +1000)]
doc: split the tablet pad events into their own doxygen module page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agoutil: add safe_atoi helper function
Peter Hutterer [Wed, 25 May 2016 03:29:32 +0000 (13:29 +1000)]
util: add safe_atoi helper function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agoMerge branch 'wip/touchpad-drop-hysteresis'
Peter Hutterer [Sun, 19 Jun 2016 23:26:44 +0000 (09:26 +1000)]
Merge branch 'wip/touchpad-drop-hysteresis'

8 years agotouchpad: re-enable hysteresis by default for all devices
Peter Hutterer [Thu, 16 Jun 2016 06:11:56 +0000 (16:11 +1000)]
touchpad: re-enable hysteresis by default for all devices

The removal of the hysteresis even on precise touchpads has led to
difficulties controlling the cursor in a few instances. Since 27078b2667d
we only have the hysteresis on Apple touchpads and the Lenovo *40 series and
later. Even on those do we see some positioning difficulties (bug 94379).

So restore the hysteresis by default again for all touchpads. In the future a
knob could be exposed for precision vs reactivity or something, but for now
the drawback of imprecise positioning does not outweigh the benefits we get
on those few devices.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoRevert "touchpad: reset the motion history on significant negative pressure changes"
Peter Hutterer [Thu, 16 Jun 2016 06:10:21 +0000 (16:10 +1000)]
Revert "touchpad: reset the motion history on significant negative pressure changes"

We will reinstate the hysteresis for all devices making the negative
pressure check unncessary.

This reverts commit ef48c07a9600733e068a2a437a145862ba07fdab.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoRevert "touchpad: only use negative pressure change check on Lenovo *50 and *60 series"
Peter Hutterer [Thu, 16 Jun 2016 06:08:30 +0000 (16:08 +1000)]
Revert "touchpad: only use negative pressure change check on Lenovo *50 and *60 series"

We will reinstate the hysteresis for all devices making the negative pressure
check unncessary and thus this commit as well.

This reverts commit 2f5231cc88fccf389a78270d827f6c9201b86794.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoRevert "test: add a test for the T450 dropped motion events"
Peter Hutterer [Thu, 16 Jun 2016 06:37:29 +0000 (16:37 +1000)]
Revert "test: add a test for the T450 dropped motion events"

This reverts commit b5527fa4c73da687774971ddd7cf6ad2016f89e7.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: add an apple magicmouse device
Peter Hutterer [Wed, 15 Jun 2016 09:36:56 +0000 (19:36 +1000)]
test: add an apple magicmouse device

This device has a touchpad on the mouse but it's labeled as mouse. For litest
we only label it as LITEST_MOUSE feature and test the touchpad directly on the
device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: when creating an abs test device, force the abs->value to the mimimum
Peter Hutterer [Wed, 15 Jun 2016 23:42:56 +0000 (09:42 +1000)]
test: when creating an abs test device, force the abs->value to the mimimum

Otherwise the abs->value could lie outside the [min, max] range of the axis.
This isn't much of an issue for actual axes but in the case of ABS_MT_SLOT
(value 47) it causes errors when libevdev sanitises the event into the allowed
slot range.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: make the valgrind target depend on 'all'
Peter Hutterer [Thu, 16 Jun 2016 01:37:50 +0000 (11:37 +1000)]
test: make the valgrind target depend on 'all'

Make sure we rebuild before running valgrind, everything else is a waste of
time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: stop palm detection when a second finger is detected
Peter Hutterer [Mon, 13 Jun 2016 06:41:43 +0000 (16:41 +1000)]
touchpad: stop palm detection when a second finger is detected

This avoids accidental palm detection during two-finger scrolling if one
finger is inside the edge exclusion zone.

Palm detection is designed to avoid accidental touches while typing. If a
non-palm finger is on the touchpad already the user is unlikely to be typing.
So stop palm detection in this case and process the fingers as normal.

This implementation has a minor bug: if both palm touches start within the
palm exclusion zone within the same frame, neither will be labelled as palm
due to how we check the other touches. Since this is an extremeley niche case
we can live with that.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: split palm movement detection into a helper function
Peter Hutterer [Tue, 14 Jun 2016 23:07:48 +0000 (09:07 +1000)]
touchpad: split palm movement detection into a helper function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: don't warn about kernel jumps on semi-mt devices
Peter Hutterer [Fri, 10 Jun 2016 00:30:24 +0000 (10:30 +1000)]
touchpad: don't warn about kernel jumps on semi-mt devices

These devices are all over the place anyway, no need to spam the log, just
silently discard the jumps.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agopad: add helper function to access the libinput context
Peter Hutterer [Thu, 9 Jun 2016 01:23:43 +0000 (11:23 +1000)]
pad: add helper function to access the libinput context

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: add helper function to access the libinput context
Peter Hutterer [Thu, 9 Jun 2016 01:15:51 +0000 (11:15 +1000)]
tablet: add helper function to access the libinput context

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: add helper to get the libinput context from the evdev device
Peter Hutterer [Wed, 8 Jun 2016 22:54:00 +0000 (08:54 +1000)]
evdev: add helper to get the libinput context from the evdev device

And change the various callers, especially those where we only had the
separate struct for indentation purposes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: use the tp_libinput_context() helper
Peter Hutterer [Thu, 9 Jun 2016 01:05:12 +0000 (11:05 +1000)]
touchpad: use the tp_libinput_context() helper

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: check model flags for actual booleans
Peter Hutterer [Wed, 8 Jun 2016 22:44:30 +0000 (08:44 +1000)]
evdev: check model flags for actual booleans

The hwdb doesn't allow unsetting a property so once we start nesting model
flags it'll become important to be able to be able to unset one as well (by
assigning it to 0).

So rather than checking for existence, check whether the property is actually
set to something resembling a boolean.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agopad: change button map ordering
Peter Hutterer [Wed, 8 Jun 2016 01:22:17 +0000 (11:22 +1000)]
pad: change button map ordering

BTN_A and above sort after BTN_BASE

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: start the pad button tests at BTN_0
Peter Hutterer [Wed, 8 Jun 2016 01:16:50 +0000 (11:16 +1000)]
test: start the pad button tests at BTN_0

Oops, we didn't actually check the button mapping for most pads...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agopad: group the button state into a private struct
Peter Hutterer [Thu, 26 May 2016 00:03:47 +0000 (10:03 +1000)]
pad: group the button state into a private struct

This is only set on button events so use the same approach as for rings and
strips. No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
8 years agotouchpad: restore the hysteresis by default
Peter Hutterer [Fri, 3 Jun 2016 01:19:23 +0000 (11:19 +1000)]
touchpad: restore the hysteresis by default

A large part of the bugs seen right now are related to touchpads jittering too
much. Fixing them one by one is entertaining, but time consuming. Right now
the number of touchpads that require a hysteresis seem to outnumber those that
don't, so switch the approach around: leave the hysteresis in place but
disable it for those touchpads that don't need it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotools: print button/ring/strip info for pads
Peter Hutterer [Fri, 27 May 2016 04:56:09 +0000 (14:56 +1000)]
tools: print button/ring/strip info for pads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: show tablet-pad capabilities in libinput-list-devices
Peter Hutterer [Fri, 27 May 2016 04:25:52 +0000 (14:25 +1000)]
tools: show tablet-pad capabilities in libinput-list-devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: add missing space after listing touch/tablet capabilities
Peter Hutterer [Fri, 27 May 2016 04:25:26 +0000 (14:25 +1000)]
tools: add missing space after listing touch/tablet capabilities

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: add a check to compare local files with those in the makefile
Peter Hutterer [Fri, 27 May 2016 00:31:28 +0000 (10:31 +1000)]
doc: add a check to compare local files with those in the makefile

Avoid forgetting about adding svgs/dotfiles to the Makefile.am

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: ship the doc sources even when not building with docs
Peter Hutterer [Fri, 27 May 2016 00:10:00 +0000 (10:10 +1000)]
doc: ship the doc sources even when not building with docs

No effect so far because the dist-hook prevents us from making a tarball
without the sources anyway. But for correctness split the two up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: warn if we have invalid touchpad ranges
Peter Hutterer [Tue, 31 May 2016 04:52:57 +0000 (14:52 +1000)]
touchpad: warn if we have invalid touchpad ranges

Quite a few bugs are caused by touchpad ranges being out of whack. If we get
input events significantly outside the expected range (5% width/height as
error margin) print a warning to the log.

And add a new doc page to explain what is happening and how to fix it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: short-circuit the edge scroll handling when it's not enabled
Peter Hutterer [Mon, 30 May 2016 08:46:54 +0000 (18:46 +1000)]
touchpad: short-circuit the edge scroll handling when it's not enabled

No need to handle events properly in the edge scroll state machine when it's
not enabled. Just set any beginning touch to state AREA and move on. The rest
of the code guarantees neutral state when edge scrolling is enabled or
disabled.

This reduces the debug output produced by libinput-debug-events when edge
scrolling is disabled, preventing users from seemingly identifying
bugs where there are none.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: up the reference count for the tool in the event
Peter Hutterer [Tue, 24 May 2016 04:37:54 +0000 (14:37 +1000)]
tablet: up the reference count for the tool in the event

Make sure that the tool is valid while the event is valid, even if the device
gets destroyed before the event is destroyed.

This cannot actually be triggered right now, the event has a ref to the device
and the tools do not get removed until the device is destroyed. But for future
implementations (e.g. where the tool is otherwise automatically destroyed on
proximity out) we need to ensure the tool remains valid for the event
lifetime.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: fix link in error message - add missing '.html'
Peter Hutterer [Mon, 30 May 2016 06:09:42 +0000 (16:09 +1000)]
touchpad: fix link in error message - add missing '.html'

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: print the rotation angle in libinput-list-devices
Peter Hutterer [Mon, 30 May 2016 05:19:37 +0000 (15:19 +1000)]
tools: print the rotation angle in libinput-list-devices

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoudev: mark the Logitech M570 as trackball
Peter Hutterer [Mon, 30 May 2016 05:18:32 +0000 (15:18 +1000)]
udev: mark the Logitech M570 as trackball

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: add missing space in libinput-list-devices output
Peter Hutterer [Mon, 30 May 2016 05:15:50 +0000 (15:15 +1000)]
tools: add missing space in libinput-list-devices output

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: grammar fix in the Makefile
Peter Hutterer [Fri, 27 May 2016 00:11:52 +0000 (10:11 +1000)]
doc: grammar fix in the Makefile

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: add the missing svg files to the Makefile.am
Peter Hutterer [Fri, 27 May 2016 00:35:34 +0000 (10:35 +1000)]
doc: add the missing svg files to the Makefile.am

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: sort the svg files alphabetically
Peter Hutterer [Fri, 27 May 2016 00:33:24 +0000 (10:33 +1000)]
doc: sort the svg files alphabetically

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agopad: ignore EV_MSC events
Peter Hutterer [Wed, 25 May 2016 22:40:17 +0000 (08:40 +1000)]
pad: ignore EV_MSC events

The Wacom Express Key Remote sends the serial number via EV_MSC. At some later
point we'll need the serial to match the LEDs correctly but for now we can
ignore them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: print the pad capabilities
Peter Hutterer [Fri, 20 May 2016 04:59:45 +0000 (14:59 +1000)]
tools: print the pad capabilities

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: update ref/unref behavior for the tablet tool
Peter Hutterer [Tue, 24 May 2016 01:47:48 +0000 (11:47 +1000)]
doc: update ref/unref behavior for the tablet tool

Brings it in line with the rest of libinput.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: update doc to explicitly state that the seat isn't referenced
Peter Hutterer [Tue, 24 May 2016 01:33:50 +0000 (11:33 +1000)]
doc: update doc to explicitly state that the seat isn't referenced

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoDrop the ALPS_RUSHMORE tag
Peter Hutterer [Mon, 23 May 2016 04:33:51 +0000 (14:33 +1000)]
Drop the ALPS_RUSHMORE tag

Was only used for the touchpad hysteresis, we can re-use the wobbly touchpad
tag for this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoudev: mark ALPS touchpads fw version 300 as wobbly touchpads
Peter Hutterer [Thu, 19 May 2016 04:40:33 +0000 (14:40 +1000)]
udev: mark ALPS touchpads fw version 300 as wobbly touchpads

Includes the Dell Lattitude E5420 but since all alps touchpads with the same
fw version are the same (as far as we know) hooking this off the firmware
version should cover this generation.

https://bugzilla.redhat.com/show_bug.cgi?id=1336084

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoudev: add the Yoga 2 to the wobbly touchpads
Peter Hutterer [Thu, 19 May 2016 05:04:24 +0000 (15:04 +1000)]
udev: add the Yoga 2 to the wobbly touchpads

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>