platform/upstream/libinput.git
8 years agotouchpad: init a default hysteresis for ALPS rushmore touchpads
Peter Hutterer [Tue, 9 Feb 2016 00:43:45 +0000 (10:43 +1000)]
touchpad: init a default hysteresis for ALPS rushmore touchpads

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoudev: fix ALPS firmware detection
Peter Hutterer [Tue, 9 Feb 2016 00:37:42 +0000 (10:37 +1000)]
udev: fix ALPS firmware detection

The firmware version is in id.version, not id.model which is always
PSMOUSE_ALPS for ALPS devices.

The various fw versions are listed in <kernel>/drivers/input/mouse/alps.h and
are all hex numbers. Version 8 is actually 0x800, change the match
accordingly.

Expected side-effect: earlier versions of ALPS touchpads now lose their
(erroneous) size assignment.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: change tilt axes to use degrees
Peter Hutterer [Tue, 2 Feb 2016 06:15:40 +0000 (16:15 +1000)]
tablet: change tilt axes to use degrees

The Wacom tilt range is 64 degrees so we map everything into that until we
know otherwise.

This commit also switches the tilt axes around to align the angles with the
x/y orientation, i.e. tilting the top of the stylus towards the positive x
axis now generates a positive x tilt.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotouchpad: fix dwt disabling while a key is still down
Peter Hutterer [Mon, 8 Feb 2016 01:48:51 +0000 (11:48 +1000)]
touchpad: fix dwt disabling while a key is still down

If dwt is disabled on the commandline, e.g. by setting an xinput property it
may be disabled before the release event comes in. This caused the timer to
refresh indefinitely since the key state mask was still on for that key.
Always updating the key state mask (even when dwt is disabled) fixes that.

If a key is held down while dwt is disabled, this can still cause a indefinite
timer refresh, so in the timer func, check if dwt is enabled before refreshing
the timer.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoIndentation fixes
Peter Hutterer [Fri, 5 Feb 2016 00:15:35 +0000 (10:15 +1000)]
Indentation fixes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: fix output to say TABLET_TOOL instead of just tablet
Peter Hutterer [Wed, 3 Feb 2016 06:47:17 +0000 (16:47 +1000)]
tools: fix output to say TABLET_TOOL instead of just tablet

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: if we have a serio keyboard, override any previous dwt pairing
Peter Hutterer [Thu, 4 Feb 2016 01:20:38 +0000 (11:20 +1000)]
touchpad: if we have a serio keyboard, override any previous dwt pairing

If a USB keyboard like the YubiKey is found before the internal keyboard, it
will be paired with the touchpad when it is seen. The internal keyboard is
seen later bug ignored because we already have a keyboard paired with the
touchpad.

This is obviously wrong. For now, give priority to serio keyboards, and
override existing dwt pairings with the new keyboard.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: while a key is held down, don't disable dwt
Peter Hutterer [Wed, 3 Feb 2016 22:31:25 +0000 (08:31 +1000)]
touchpad: while a key is held down, don't disable dwt

If a key enables dwt and is held down when the timeout expires, re-issue the
timeout.

There is a corner case where dwt may not work as expected:
1. key down and held down
2. dwt timer expires, dwt is re-issued
3. touch starts
4. key is released
5. dwt timer expires
6. touch now starts moving the pointer

This is an effect of the smart touch detection. A touch starting after the
last key press is released for pointer motion once dwt turns off again. This
is what happens in the above case, the dwt timer expiring is the last virtual
key press. This is a corner case and likely hard to trigger by a real user.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: fix leaking libevdev fd
Peter Hutterer [Thu, 4 Feb 2016 11:08:30 +0000 (21:08 +1000)]
test: fix leaking libevdev fd

This was the reason for the valgrind test case failures whenever we
accumulated too many tests (see 9c2afae1 and 2a110104). The cause was simply
that we ran out of fds which caused libevdev to fail the scandir() searching
for the event node. That resulted in a NULL devnode and an abort in litest.

Close the fd before freeing the evdev device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix the udev rule for the synaptics hover device
Peter Hutterer [Thu, 4 Feb 2016 06:25:33 +0000 (16:25 +1000)]
test: fix the udev rule for the synaptics hover device

Missing \\ for a udev rule split across two lines

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: drop motion hysteresis by default
Peter Hutterer [Fri, 29 Jan 2016 06:25:31 +0000 (16:25 +1000)]
touchpad: drop motion hysteresis by default

Some older touchpad devices jitter a fair bit when a finger is resting on the
touchpad. That's why the hysteresis was introduced in the synaptics driver
back in 2011. However, the default value of the hysteresis in the synaptics
driver ended up being 0, even though the code looks like it's using a fraction
of the touchpad diagonal. When the hysteresis code was ported to libinput it
was eventually set to 0.5mm.

Turns out this is still too high and tiny finger motions are either
nonreactive or quite jumpy, making it hard to select small targets. Drop the
default hysteresis by reducing its margin to 0, but leave it in place for
those devices where we need them (e.g. the cyapa touchpads).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: exclude semi-mt devices from the normal 2fg scroll test
Peter Hutterer [Thu, 4 Feb 2016 05:10:59 +0000 (15:10 +1000)]
test: exclude semi-mt devices from the normal 2fg scroll test

We have a specific semi-mt 2fg scroll test for those.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: check for BTN_TOOL_QUADTAP in the 4fg btntool tests
Peter Hutterer [Thu, 4 Feb 2016 03:35:08 +0000 (13:35 +1000)]
test: check for BTN_TOOL_QUADTAP in the 4fg btntool tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix printfs to say "TABLET TOOL" instead of "TABLET"
Peter Hutterer [Wed, 3 Feb 2016 07:11:42 +0000 (17:11 +1000)]
test: fix printfs to say "TABLET TOOL" instead of "TABLET"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: change error message to TABLET_TOOL from TABLET
Peter Hutterer [Mon, 1 Feb 2016 07:19:55 +0000 (17:19 +1000)]
tablet: change error message to TABLET_TOOL from TABLET

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: be more specific about tablet vs tablet tool
Peter Hutterer [Thu, 21 Jan 2016 01:42:32 +0000 (11:42 +1000)]
doc: be more specific about tablet vs tablet tool

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: add the tablet support page to the related pages hierarchy
Peter Hutterer [Tue, 2 Feb 2016 03:52:54 +0000 (13:52 +1000)]
doc: add the tablet support page to the related pages hierarchy

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix call to test_2fg_scroll
Peter Hutterer [Mon, 1 Feb 2016 00:42:42 +0000 (10:42 +1000)]
test: fix call to test_2fg_scroll

Last argument is a boolean whether we want to have a tap timeout. It used to
be the ms to sleep, obsolete since e4adbff919223

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: add two gesture tests for scrolling with a thumb in the btnarea
Peter Hutterer [Fri, 29 Jan 2016 01:18:35 +0000 (11:18 +1000)]
test: add two gesture tests for scrolling with a thumb in the btnarea

If a finger is resting in the software button area, it must not be counted
towards the gesture. So a two-finger movement must be a scroll event, not a
three-finger pinch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: disable the mode button on the Cyborg RAT 5
Peter Hutterer [Fri, 29 Jan 2016 00:09:13 +0000 (10:09 +1000)]
evdev: disable the mode button on the Cyborg RAT 5

This button sends a release N, press N+1 on each press, cycling through the
three event codes supported. This causes a stuck button since the current mode
is never released.

Long-term this better served by a set of switches that toggle accordingly, for
now disable the button codes.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotools: split drawing commands into helper functions
Peter Hutterer [Fri, 29 Jan 2016 06:05:25 +0000 (16:05 +1000)]
tools: split drawing commands into helper functions

Makes the draw() call a bit easier to read

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: draw the pointer sprite last
Peter Hutterer [Thu, 28 Jan 2016 06:31:22 +0000 (16:31 +1000)]
tools: draw the pointer sprite last

Don't hide it behind other things

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoconfigure.ac: libinput 1.2rc1 1.1.901
Peter Hutterer [Thu, 28 Jan 2016 01:51:48 +0000 (11:51 +1000)]
configure.ac: libinput 1.2rc1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoMerge branch 'tablet-support'
Peter Hutterer [Wed, 27 Jan 2016 06:02:47 +0000 (16:02 +1000)]
Merge branch 'tablet-support'

8 years agoPrepare tablet-support branch for merging
Peter Hutterer [Wed, 27 Jan 2016 05:38:47 +0000 (15:38 +1000)]
Prepare tablet-support branch for merging

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoMerge branch 'master' into tablet-support
Peter Hutterer [Wed, 27 Jan 2016 03:54:00 +0000 (13:54 +1000)]
Merge branch 'master' into tablet-support

8 years agotouchpad: add a config option to disable tap-and-drag
Peter Hutterer [Fri, 22 Jan 2016 07:59:19 +0000 (17:59 +1000)]
touchpad: add a config option to disable tap-and-drag

There are a number of use-cases where tapping may be desirable, but
tap-and-drag is not, e.g. where tapping is used to select multiple items in a
list. Having tap-and-drag on hinders this, and the nature of the interaction
means it cannot be detected based on timeouts, movement thresholds, etc.

Provide an option instead to turn tap-an-drag off. Tap-and-drag remains
enabled by default (though tapping is disabled by default).

For the touchpad tap state diagram, the new option disables the transition
from state TOUCH to state TAPPED and releases the button immediately instead.
This means that multitap-and-drag is disabled too since we now just loop
around in the single-tap state for multitap.

It also makes tapping more responsive - we don't have to wait for the timeout
before we know whether it's a tap event. The first touch time is noted, we now
send the button press with the time of the first touch and the release with
the time of the release. This ensures a realistic time diff between the two
events.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.netto>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agogestures: average motion by active touches, not moved touches
Peter Hutterer [Mon, 25 Jan 2016 01:19:58 +0000 (11:19 +1000)]
gestures: average motion by active touches, not moved touches

When two fingers move slowly, an event frame may only have one finger motion,
followed by a frame with the other finger's motion. If we only divide by the
number of dirty touches, the speed of the gesture increases whenever that
happens.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoMerge branch 'master' into tablet-support
Peter Hutterer [Mon, 25 Jan 2016 05:29:11 +0000 (15:29 +1000)]
Merge branch 'master' into tablet-support

8 years agogestures: average motion by active touches, not moved touches
Peter Hutterer [Mon, 25 Jan 2016 01:19:58 +0000 (11:19 +1000)]
gestures: average motion by active touches, not moved touches

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogestures: jump straight to swipe for 3+ finger gestures on ST touchpads
Peter Hutterer [Mon, 25 Jan 2016 00:50:02 +0000 (10:50 +1000)]
gestures: jump straight to swipe for 3+ finger gestures on ST touchpads

The first/second variables are only needed for pinch, so we can skip them
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agogestures: jump straight to swipe for 3+ finger gestures on ST touchpads
Peter Hutterer [Mon, 25 Jan 2016 00:50:02 +0000 (10:50 +1000)]
gestures: jump straight to swipe for 3+ finger gestures on ST touchpads

The first/second variables are only needed for pinch, so we can skip them
here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: remove unused variable
Peter Hutterer [Mon, 25 Jan 2016 00:15:58 +0000 (10:15 +1000)]
touchpad: remove unused variable

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoMerge branch 'wip/disable-semi-mt-gestures'
Peter Hutterer [Mon, 25 Jan 2016 00:11:30 +0000 (10:11 +1000)]
Merge branch 'wip/disable-semi-mt-gestures'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: remove unused field multitap_last_time
Peter Hutterer [Sun, 24 Jan 2016 22:21:12 +0000 (08:21 +1000)]
touchpad: remove unused field multitap_last_time

Unused since d92ae62dad53afd894a

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: fix potential null-pointer dereference
Peter Hutterer [Fri, 22 Jan 2016 08:08:44 +0000 (18:08 +1000)]
tablet: fix potential null-pointer dereference

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix uninitialized variable
Peter Hutterer [Fri, 22 Jan 2016 08:06:01 +0000 (18:06 +1000)]
test: fix uninitialized variable

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: shut up coverity warnings
Peter Hutterer [Fri, 22 Jan 2016 08:04:41 +0000 (18:04 +1000)]
test: shut up coverity warnings

Coverity claims they're used uninitialized which isn't true. The condition
that guards it's use also guards its initialization.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: rename the tap tests suite name to "tap:..."
Peter Hutterer [Fri, 22 Jan 2016 07:38:14 +0000 (17:38 +1000)]
test: rename the tap tests suite name to "tap:..."

Better than just having one single suite

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: add support for tablet relative events to the event-gui
Peter Hutterer [Tue, 12 Jan 2016 06:39:15 +0000 (16:39 +1000)]
tools: add support for tablet relative events to the event-gui

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: hook up relative motion events
Peter Hutterer [Wed, 6 Jan 2016 05:26:49 +0000 (15:26 +1000)]
tablet: hook up relative motion events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: add support for relative x/y motion deltas
Peter Hutterer [Wed, 6 Jan 2016 04:47:18 +0000 (14:47 +1000)]
tablet: add support for relative x/y motion deltas

Instead of an explicit tablet mode that device must be changed into, let the
caller decide which coordinates are preferred. The tablet mode may be
application-specific and usually depends on the tool as well.

This patch adds an interface to get a motion delta for the x/y axes in
pixel-like coordinates. libinput provides some magic to convert the tablet
data into something that resembles pixels from a mouse motion.
For unaccelerated relative motion, the caller should use the mm values from
the tablet and calculate deltas manually.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotouchpad: disable gestures for single-finger touchpads
Peter Hutterer [Fri, 22 Jan 2016 00:08:56 +0000 (10:08 +1000)]
touchpad: disable gestures for single-finger touchpads

No point trying to detect pinch gestures if we only have one set of
coordinates. This makes two-finger scrolling on ST touchpads more reactive.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: disable MT for all semi-mt devices
Peter Hutterer [Mon, 18 Jan 2016 23:05:31 +0000 (09:05 +1000)]
touchpad: disable MT for all semi-mt devices

Synaptics, Elantech and Alps semi-mt devices all have issues with reporting
correct MT data, even the bounding box which semi-mt devices are supposed to
report is wrong.

Synaptics devices have massive jumps with two fingers down. Elantech devices
may open slots without coordinate data. Alps devices may send 0/0 coordinates
as initial slot position.

All these may be addressable with specific quirks, but the actual benefit is
largely restricted to better palm detection (though even with quirks this is
unlikely to work) and support for pinch gestures (again, lack of coordinates
makes supporting those hard anyway).

Elantech: https://bugs.freedesktop.org/show_bug.cgi?id=93583
Alps: https://bugzilla.redhat.com/show_bug.cgi?id=1295073

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: when moving 2 fingers, move them in the same frame
Peter Hutterer [Fri, 22 Jan 2016 01:36:40 +0000 (11:36 +1000)]
test: when moving 2 fingers, move them in the same frame

More accurate representation of what we actually want to do. Plus it avoids
weird test case failures in semi-mt where we always pick the t/l and b/r
touches for the bounding box. That is the proper behavior for semi-mt, but
it's not for the tests where we expect simultaneous finger movement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: don't try to unhover touches if nothing changed
Peter Hutterer [Mon, 18 Jan 2016 07:04:39 +0000 (17:04 +1000)]
touchpad: don't try to unhover touches if nothing changed

If the touch hasn't updated, the distance hasn't changed so there is no need
to unhover.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoMerge branch 'wip/3-finger-pinch-gesture'
Peter Hutterer [Wed, 20 Jan 2016 05:38:17 +0000 (15:38 +1000)]
Merge branch 'wip/3-finger-pinch-gesture'

8 years agodoc: explain the gesture ambiguity for 2-slot touchpads
Peter Hutterer [Fri, 8 Jan 2016 03:28:21 +0000 (13:28 +1000)]
doc: explain the gesture ambiguity for 2-slot touchpads

Not much we can do about this until we get SMBus/RMI4 in the kernel or better
touchpads in general but this way we can at least point to some official
explanation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogestures: if a finger is 20mm below the other one, assume a pinch gesture
Peter Hutterer [Fri, 8 Jan 2016 01:30:08 +0000 (11:30 +1000)]
gestures: if a finger is 20mm below the other one, assume a pinch gesture

Pure movement detection is quite unreliable when trying 3-finger pinch
gestures, and many gestures are misdetected as swipes. Before looking at the
motion, look at the constellation of the fingers. If one finger is 20mm below
the other one, assume they're in a pinch position.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: add more gesture tests
Peter Hutterer [Thu, 7 Jan 2016 05:00:53 +0000 (15:00 +1000)]
test: add more gesture tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogestures: add support for three-finger pinch gestures
Peter Hutterer [Thu, 7 Jan 2016 01:37:20 +0000 (11:37 +1000)]
gestures: add support for three-finger pinch gestures

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: change semi-mt 2fg scroll test to use two-finger movement
Peter Hutterer [Fri, 8 Jan 2016 03:45:42 +0000 (13:45 +1000)]
test: change semi-mt 2fg scroll test to use two-finger movement

As we implement more gestures, we will drop two-finger scrolling performed by
only a single finger movement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: rearrange fingers for gesture tests
Peter Hutterer [Fri, 8 Jan 2016 01:06:49 +0000 (11:06 +1000)]
test: rearrange fingers for gesture tests

Prep work for the coming patch, arrange the fingers horizontally rather than
vertically.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: check fake finger count for validity
Peter Hutterer [Thu, 7 Jan 2016 05:49:02 +0000 (15:49 +1000)]
touchpad: check fake finger count for validity

Setting TRIPLETAP unsets DOUBLETAP, etc. This doesn't usually happen with
kernel devices, but every once in a while I get this wrong in a test and spend
hours debugging the code...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: run pinch gesture tests for 2-slot touchpads
Peter Hutterer [Thu, 7 Jan 2016 04:39:52 +0000 (14:39 +1000)]
test: run pinch gesture tests for 2-slot touchpads

Some of the 2-slot touchpads don't do gestures though (e.g. semi-mt) so skip
those.

And change the movement granularity for the pinch and spread tests so we stay
under one degree angle for lower-resolution touchpads too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: remove a wait loop from the usec gesture test
Peter Hutterer [Thu, 7 Jan 2016 04:33:26 +0000 (14:33 +1000)]
test: remove a wait loop from the usec gesture test

We know we (should) have events when we get here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: remove leftover debug_trace statement
Peter Hutterer [Thu, 7 Jan 2016 04:27:04 +0000 (14:27 +1000)]
test: remove leftover debug_trace statement

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogestures: pass the finger count into pinch events
Peter Hutterer [Thu, 7 Jan 2016 03:57:03 +0000 (13:57 +1000)]
gestures: pass the finger count into pinch events

Prep work for multifinger pinch gestures

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: constify a couple of helper functions
Peter Hutterer [Thu, 7 Jan 2016 03:04:58 +0000 (13:04 +1000)]
touchpad: constify a couple of helper functions

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogestures: drop 2fg naming from the various states
Peter Hutterer [Thu, 7 Jan 2016 01:40:42 +0000 (11:40 +1000)]
gestures: drop 2fg naming from the various states

When adding 3+ finger gestures, there isn't much specific state left that's
2-finger only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogestures: split direction check out into a helper function
Peter Hutterer [Thu, 7 Jan 2016 00:30:46 +0000 (10:30 +1000)]
gestures: split direction check out into a helper function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix compiler warning
Peter Hutterer [Wed, 20 Jan 2016 02:56:08 +0000 (12:56 +1000)]
test: fix compiler warning

litest-selftest.c: In function â€˜litest_ptr_eq_notrigger’:
litest-selftest.c:172:10: warning: initialization makes integer from pointer
without a cast [-Wint-conversion]
  int c = NULL;
          ^
litest-selftest.c:173:10: warning: initialization makes integer from pointer
without a cast [-Wint-conversion]
  int d = NULL;
          ^

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agogitignore: ignore compile script generated by automake >= 1.14
Olivier Blin [Tue, 19 Jan 2016 14:10:21 +0000 (15:10 +0100)]
gitignore: ignore compile script generated by automake >= 1.14

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoMerge branch 'master' into tablet-support
Peter Hutterer [Tue, 19 Jan 2016 02:02:51 +0000 (12:02 +1000)]
Merge branch 'master' into tablet-support

8 years agotouchpad: drop the model detection - write-only value
Peter Hutterer [Mon, 18 Jan 2016 06:44:28 +0000 (16:44 +1000)]
touchpad: drop the model detection - write-only value

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: drop delta array, provided by the tablet_axis struct now
Peter Hutterer [Wed, 6 Jan 2016 06:20:38 +0000 (16:20 +1000)]
tablet: drop delta array, provided by the tablet_axis struct now

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: use a struct rather than a double array for axis values
Peter Hutterer [Wed, 6 Jan 2016 06:16:46 +0000 (16:16 +1000)]
tablet: use a struct rather than a double array for axis values

Makes the code less generic, but more expressive. No visible functional
changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotools: share the axis and tip code where appropriate
Peter Hutterer [Tue, 12 Jan 2016 04:41:57 +0000 (14:41 +1000)]
tools: share the axis and tip code where appropriate

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotools: get pressure/distance/tilt from a tip event too
Peter Hutterer [Tue, 12 Jan 2016 04:40:27 +0000 (14:40 +1000)]
tools: get pressure/distance/tilt from a tip event too

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: allow the various get_<axis> on tablet button events
Peter Hutterer [Thu, 14 Jan 2016 04:12:28 +0000 (14:12 +1000)]
tablet: allow the various get_<axis> on tablet button events

There's no reason to prevent this for button events. Unlike the pointer
which is a relative device a tablet is (usually) a device with a lot of state.
Caller code that handles axes is likely shared between the various events,
treating button events separately here doesn't get us any benefit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotouchpad: disable MT for elantech semi-mt touchpads
Peter Hutterer [Tue, 12 Jan 2016 02:24:18 +0000 (12:24 +1000)]
touchpad: disable MT for elantech semi-mt touchpads

When three fingers are set down on the touchpad, one finger tends to get a 0/0
coordinate, triggering palm detection in the upper left corner. Handle this
like the jumping semi-mt touchpads and disable MT handling and instead
just rely on the x/y axis and the BTN_TOOL_* events.

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

This kernel patch is required:
https://lkml.org/lkml/2016/1/11/171

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agodoc: add section names to motion normalization subheaders
Peter Hutterer [Wed, 13 Jan 2016 01:50:21 +0000 (11:50 +1000)]
doc: add section names to motion normalization subheaders

Otherwise the first word is used as section header and discarded from the
output.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: whitespace fix
Peter Hutterer [Tue, 12 Jan 2016 22:48:12 +0000 (08:48 +1000)]
touchpad: whitespace fix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: drop outdated comment
Peter Hutterer [Tue, 12 Jan 2016 02:16:25 +0000 (12:16 +1000)]
touchpad: drop outdated comment

Obsolete comment since 4ca70c813f750721592d1a68aced385560705256, we rely on
the udev hwdb to set the resolution for us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: only reject devices with missing MT x/y if they're MT devices
Peter Hutterer [Wed, 23 Dec 2015 05:15:29 +0000 (15:15 +1000)]
evdev: only reject devices with missing MT x/y if they're MT devices

A fake MT device may have ABS_MT_POSITION_X but not Y. In this case we don't
care, because we don't handle those axes anyway.

http://bugs.freedesktop.org/show_bug.cgi?id=93474

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: don't set a pressure offset of 0
Peter Hutterer [Tue, 5 Jan 2016 01:09:35 +0000 (11:09 +1000)]
tablet: don't set a pressure offset of 0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: a tip event can replace an axis event
Peter Hutterer [Mon, 14 Dec 2015 22:39:56 +0000 (08:39 +1000)]
tablet: a tip event can replace an axis event

When we're only dealing with BTN_TOUCH we can make the tip event independent
of the axis event. Now that we handle pressure thresholds to trigger tip state
this does not work, we'd have to send an axis event with the new pressure and
then a tip event. Since the pressure triggers the tip event this seems
disconnected.

Make the tip event officially capable of carrying axes. A caller can then
decide how to forward this to the next layer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: add pressure threshold handling
Peter Hutterer [Fri, 11 Dec 2015 07:40:36 +0000 (17:40 +1000)]
tablet: add pressure threshold handling

On tablets with ABS_PRESSURE use a pressure value to determine tip state, not
BTN_TOUCH. This enables us (down the road) to have device-specific pressure
thresholds. For now we use a 5% default for all devices.

The threshold is a range, if we go past the upper range we initiate the tip
down, if we go below the lower range we release the tip again.

This affects two current tests:
* Once we have pressure offsets and pressure thresholds, we're biased towards
pressure. So we can only check that distance is zero when there is a pressure
value, not the other way round.
* When the pressure threshold is exceeded on proximity in with a nonzero
distance, we can only warn and handle the pressure as normal. Since this is a
niche case anyway anything fancier is likely unnecessary.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotest: fix a bunch of tablet tests for pressure threshold introduction
Peter Hutterer [Sun, 13 Dec 2015 22:05:32 +0000 (08:05 +1000)]
test: fix a bunch of tablet tests for pressure threshold introduction

Preparation work for a pressure threshold where we can't just send a BTN_TOUCH
and expect it to trigger the tip event. So the event sequence now needs to
resemble the right order so the threshold will be triggered.

In some cases requires processing an axis event before the tip event. That
behavior will be changed in a follow-up commit.

It also requires that all tablets set ABS_PRESSURE on proximity in.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: always set the pressure offset
Peter Hutterer [Mon, 21 Dec 2015 02:53:00 +0000 (12:53 +1000)]
tablet: always set the pressure offset

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotablet: whitespace fix
Peter Hutterer [Wed, 6 Jan 2016 04:47:47 +0000 (14:47 +1000)]
tablet: whitespace fix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: fix two grammar issues "of tablet tool" -> "of the tablet tool"
Peter Hutterer [Wed, 6 Jan 2016 03:31:17 +0000 (13:31 +1000)]
doc: fix two grammar issues "of tablet tool" -> "of the tablet tool"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: print the button name too, not just the code
Peter Hutterer [Tue, 5 Jan 2016 06:11:09 +0000 (16:11 +1000)]
tools: print the button name too, not just the code

new output:
event4  POINTER_BUTTON    +0.84s BTN_RIGHT (273) released, seat count: 0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: fix DWT pairing for Macbook Pro 2015
Caibin Chen [Mon, 14 Dec 2015 06:27:55 +0000 (22:27 -0800)]
touchpad: fix DWT pairing for Macbook Pro 2015

Label internal keyboards through the udev hwdb and only pair the internal
(usb) Apple touchpads with those keyboards labelled as such.

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

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: insert "STATE" into proximity/tip states
Peter Hutterer [Tue, 5 Jan 2016 04:08:01 +0000 (14:08 +1000)]
tablet: insert "STATE" into proximity/tip states

Makes it even longer, but at least it's consistent with button and key state.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agodoc: add missing tip event to the allowed set of events
Peter Hutterer [Tue, 5 Jan 2016 03:33:51 +0000 (13:33 +1000)]
doc: add missing tip event to the allowed set of events

We can call the various has_changed() functions on a tip event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: fix and improve the tablet documentation
Peter Hutterer [Tue, 5 Jan 2016 03:19:56 +0000 (13:19 +1000)]
doc: fix and improve the tablet documentation

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: improve absolute axis documentation a bit
Peter Hutterer [Tue, 5 Jan 2016 02:35:49 +0000 (12:35 +1000)]
doc: improve absolute axis documentation a bit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: explicitly set the tip state on the proximity event
Peter Hutterer [Mon, 21 Dec 2015 05:24:03 +0000 (15:24 +1000)]
tablet: explicitly set the tip state on the proximity event

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix a bunch of tablet tests to assume, rather than wait for events
Peter Hutterer [Mon, 21 Dec 2015 05:42:33 +0000 (15:42 +1000)]
test: fix a bunch of tablet tests to assume, rather than wait for events

litest_wait_for_event_of_type() skips all other events in the queue before the
one we want. This isn't appropriate in most cases, and unless we're dealing
with timeouts we should assume that a certain sequence triggered a specific
event rather than waiting some time for it to trigger.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: split sanitize_tablet_axes up into two helpers
Peter Hutterer [Mon, 14 Dec 2015 22:39:56 +0000 (08:39 +1000)]
tablet: split sanitize_tablet_axes up into two helpers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoAdd event debugging to libinput_post_event
Peter Hutterer [Sun, 13 Dec 2015 21:39:26 +0000 (07:39 +1000)]
Add event debugging to libinput_post_event

Print the type of event when it is queued up internally. This makes it a lot
easier to associate evdev events with the libinput event queued up and does
not depend on the caller calling libinput_dispatch().

Since this should only be used during development, hide it behind an if 0.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: use the litest_axis_set_value helper
Peter Hutterer [Tue, 22 Dec 2015 23:52:13 +0000 (09:52 +1000)]
test: use the litest_axis_set_value helper

Should've been part of 2f481ba4a2 during rebasing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: add two more tests for correct button sequence on proximity
Peter Hutterer [Thu, 3 Dec 2015 01:19:44 +0000 (11:19 +1000)]
test: add two more tests for correct button sequence on proximity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: handle custom proximity handling
Peter Hutterer [Wed, 2 Dec 2015 07:16:18 +0000 (17:16 +1000)]
tablet: handle custom proximity handling

For the puck/lens cursor tool we need to artificially reduce proximity
detection. These tools are usually used in a relative mode (i.e. like a mouse)
and thus require lifting and resetting the tool multiple times to move across
the screen. The tablets' distance detection goes too far, requiring the user
to lift the device several cm on every move. This is uncomfortable.

Introduce an artificial distance threshold for the devices with the default
value taken from the X.Org wacom driver. If a tool is in proximity but outside
of this range, fake proximity events accordingly.

If a button was pressed while we were out of range we discard that event and
send it later when we enter proximity again.

This is the simple implementation that only takes one proximity out value (the
one from the wacom driver) and applies it to all. Those devices that support a
button/lens tool and have a different default threshold are well out of date.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
[rebased, tests updated for new axis percentage behavior (8d76734f)]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: drop unused argument from tablet_mark_all_axes_changed
Peter Hutterer [Tue, 22 Dec 2015 23:04:12 +0000 (09:04 +1000)]
tablet: drop unused argument from tablet_mark_all_axes_changed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: invert tilt axes when left-handed is enabled
Peter Hutterer [Tue, 15 Dec 2015 03:58:01 +0000 (13:58 +1000)]
tablet: invert tilt axes when left-handed is enabled

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: add libinput_tablet_tool_is_unique()
Peter Hutterer [Tue, 15 Dec 2015 02:39:52 +0000 (12:39 +1000)]
tablet: add libinput_tablet_tool_is_unique()

For checking if a tablet tool can be uniquely identified by libinput. In
practice this means checking for a nonzero serial number, but let's not
restrict ourselves to allowing just that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: simplify marking axes as changed
Peter Hutterer [Tue, 15 Dec 2015 01:18:14 +0000 (11:18 +1000)]
tablet: simplify marking axes as changed

The only time we need this is on proximity in, so move it to where we handle
that to have better locality. And rather than looping through and checking
each bit, just memcpy the axis capabilities, because by definition they
represent the set of axes that can possibly change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: don't mark all axes changed on init
Peter Hutterer [Tue, 15 Dec 2015 01:15:36 +0000 (11:15 +1000)]
tablet: don't mark all axes changed on init

This will be set when the tool comes into proximity later.

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