Commit graph

1914 commits

Author SHA1 Message Date
Peter Hutterer
d8eced2afe tablet: move clearing the tilt bits up to where we reset the axes
No functional change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 12:05:16 +10:00
Peter Hutterer
ebe02cb19e tablet: delay initial proximity in event until we have a serial
If the tablet is already in proximity on startup, we used to immediately sent
a proximity event. We can't fetch MSC_SERIAL from the kernel, so that tool
always had a serial of 0, followed by events with the real serial. Since
clients are supposed to use the serial for the tracking of tools, this is
suboptimal.

When the tablet is added, merely set the internal proximity flags. This way we
wait until the first real event from the device (which includes the serial
number) and convert that into a proximity event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10 12:02:08 +10:00
Peter Hutterer
07420eec05 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>
2016-02-10 08:08:31 +10:00
Peter Hutterer
1f304763b4 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>
2016-02-10 08:08:31 +10:00
Peter Hutterer
c9abcb2e1c 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>
2016-02-09 12:19:12 +10:00
Peter Hutterer
0e87dc9af2 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>
2016-02-09 07:40:04 +10:00
Peter Hutterer
4392cb5796 Indentation fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05 15:39:58 +10:00
Peter Hutterer
cbf775ba3d tools: fix output to say TABLET_TOOL instead of just tablet
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05 15:34:25 +10:00
Peter Hutterer
0b0150e08d 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>
2016-02-05 07:43:25 +10:00
Peter Hutterer
b27f04689e 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>
2016-02-05 07:40:51 +10:00
Peter Hutterer
a84bf167a3 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>
2016-02-05 07:40:50 +10:00
Peter Hutterer
57527623ee 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>
2016-02-04 16:26:29 +10:00
Peter Hutterer
f6c2d4b8b5 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>
2016-02-04 15:12:55 +10:00
Peter Hutterer
c352a50295 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>
2016-02-04 15:12:55 +10:00
Peter Hutterer
bcbe579e1c test: check for BTN_TOOL_QUADTAP in the 4fg btntool tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 13:50:49 +10:00
Peter Hutterer
7b21026e3a test: fix printfs to say "TABLET TOOL" instead of "TABLET"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 08:00:06 +10:00
Peter Hutterer
e086f9cf92 tablet: change error message to TABLET_TOOL from TABLET
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 07:59:07 +10:00
Peter Hutterer
87d60276f3 doc: be more specific about tablet vs tablet tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04 07:58:39 +10:00
Peter Hutterer
3bea95c851 doc: add the tablet support page to the related pages hierarchy
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-02 13:55:01 +10:00
Peter Hutterer
d76dc643cd 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 e4adbff919

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-01 12:14:09 +10:00
Peter Hutterer
e808b47b82 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>
2016-02-01 08:38:23 +10:00
Peter Hutterer
e19d5d228c 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>
2016-02-01 08:37:41 +10:00
Peter Hutterer
7381ea7a5c 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>
2016-01-29 16:06:29 +10:00
Peter Hutterer
9d7f97390d tools: draw the pointer sprite last
Don't hide it behind other things

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-28 16:31:22 +10:00
Peter Hutterer
19e1a0bb6f configure.ac: libinput 1.2rc1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-28 11:51:48 +10:00
Peter Hutterer
4b4172a8e6 Merge branch 'tablet-support' 2016-01-27 16:02:47 +10:00
Peter Hutterer
62a0097d96 Prepare tablet-support branch for merging
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-27 15:38:47 +10:00
Peter Hutterer
ae41aa146d Merge branch 'master' into tablet-support 2016-01-27 13:54:00 +10:00
Peter Hutterer
cba2278c3a 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>
2016-01-27 10:03:28 +10:00
Peter Hutterer
f8bcbc2dbb 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>
2016-01-27 09:51:05 +10:00
Peter Hutterer
de3f1fa6fa Merge branch 'master' into tablet-support 2016-01-25 15:29:11 +10:00
Peter Hutterer
b6f59d0e3b gestures: average motion by active touches, not moved touches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 12:51:29 +10:00
Peter Hutterer
6ad303b3d3 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>
2016-01-25 11:31:37 +10:00
Peter Hutterer
71fcd387f7 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>
2016-01-25 11:31:37 +10:00
Peter Hutterer
05bec98681 touchpad: remove unused variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 11:31:37 +10:00
Peter Hutterer
f0fa09c73f Merge branch 'wip/disable-semi-mt-gestures'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 11:31:35 +10:00
Peter Hutterer
25ab3d4615 touchpad: remove unused field multitap_last_time
Unused since d92ae62dad

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25 08:28:43 +10:00
Peter Hutterer
6920a42fd4 tablet: fix potential null-pointer dereference
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-22 18:08:44 +10:00
Peter Hutterer
a6b43386d6 test: fix uninitialized variable
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-22 18:06:01 +10:00
Peter Hutterer
f5a60d1d82 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>
2016-01-22 18:04:41 +10:00
Peter Hutterer
7f16a8818d 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>
2016-01-22 17:38:14 +10:00
Peter Hutterer
7899a6cf8d 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>
2016-01-22 16:16:55 +10:00
Peter Hutterer
7164d6eff5 tablet: hook up relative motion events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-22 16:16:55 +10:00
Peter Hutterer
108a191a3e 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>
2016-01-22 16:16:55 +10:00
Peter Hutterer
28205d6f29 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>
2016-01-22 11:50:45 +10:00
Peter Hutterer
342bc51016 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>
2016-01-22 11:50:45 +10:00
Peter Hutterer
d19307f20d 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>
2016-01-22 11:37:51 +10:00
Peter Hutterer
14baf58e37 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>
2016-01-22 09:53:21 +10:00
Peter Hutterer
a4adea1646 Merge branch 'wip/3-finger-pinch-gesture' 2016-01-20 15:38:17 +10:00
Peter Hutterer
cab2c1640d 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>
2016-01-20 15:38:13 +10:00