Commit graph

2503 commits

Author SHA1 Message Date
Peter Hutterer
b4bb28caeb touchpad: don't try to unhover touches in NONE state
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-29 11:13:23 +10:00
Peter Hutterer
24445374b2 test: highlight the various state machines with colors
Makes visual identification easier

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
6ab2999be9 test: detect linebreaks in log messages
If a single log message is composed of multiple calls (as are all from
evdev_log_*), don't prefix multiple times.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
0bd36f2542 test: add color to litest verbose output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
937541cb82 test: align litest output messages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
7272696666 test: drop unused variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
58b89fbf2e evdev: fix typo in log message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-28 18:56:38 +10:00
Peter Hutterer
6ba530f2d8 tools: use 'required_argument'/'no_argument' for getopt_long
See the getopt_long example, makes the code more obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-24 11:42:44 +10:00
Peter Hutterer
078d5cb332 Merge branch 'wip/tablet-wobbly-lines-v2' 2017-03-23 10:18:19 +10:00
Peter Hutterer
411a3a4766 tablet: add axis smoothing
Taking the tablet events as-is produces the occasional wobble in what should
be a straight line. Bug 99961 has a jpg attachment to illustrate that.
Emulate the wacom driver behavior and average x/y across the last 4 values to
smoothen out these dents.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
ae11eaa265 tablet: reset delta and changed axes as soon as we send them
We don't have frame events for tablets so we must take care to send the
axis change notifications only once and leave the others as-is. Most of the
axes are absolute so it doesn't really matter, but we need to reset the delta
to make sure clients don't receive the same delta twice.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
a19d18f9c6 tablet: add assert that deltas are always 0
The tablet axis struct has a delta field that's only useful for the events,
not for our internal axis handling. Make sure we never set it to anything
nonzero.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
88876e66fa tablet: split point vs delta handling up
Handle the delta in the end once we've updated the device state for all axes.
This requires us to use the device history rather than the current state
delta, and it also requires us to update both x and y whenever an axis change
comes in.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
230af3f9fc table: move custom rotation handling into a helper function
This is a bit hard to follow:
- tilt is handled first and if either tilt axis is set we fetch *both* tilt axes
  into tablet->axes.tilt
- rotation is handled second but it only triggers if either tilt axis is
  flagged. as we now guarantee to have both axes in tablet->axes.tilt, we
  can continue with the rotation conversion without needing some other state

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
401bbf52d8 tablet: reshuffle device axis updates
This is prep work for axis smoothing. Modify the various helper functions to
just update the state in the tablet and then grab the state later for better
grouping.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
1e113f6283 tablet: move the axis transforms to the end
No functional changes, part of the grouping of tablet axis manipulation vs.
processing of that manipulated state.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
f8aa49b619 tablet: move delta processing down
No functional changes, this is just to group the calls that modify tablet axis
state together and move the bits that rely on this state (but don't modify it)
to the bottom.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
0d757a94f9 tablet: add a motion history
Stores the processed axes values in a history 4 events deep. Currently unused
but will be used to smoothen out axis values to avoid transducer-caused axis
wobbles.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
f5d8552cc3 tablet: move definition of tablet_axes down
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
cadefc1265 tablet: reshuffle the event sending code
The current code modifies a bit of state inside the proximity_tip_down
function which makes for confusing reading. Clean this up by having a bunch of
helper functions for the various events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
c39a84da9e tablet: remove unnecessary out-of-proximity check
This cannot trigger because we'd never get here if out-of-proximity is set,
tablet_flush() will return early.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
c8fde99ad9 tablet: drop unnecessary call to reset the changed axes
The only code path that leads here would see the changed_axes array zeroed out
in tablet_send_axis_proximity_tip_down_events(), zeroing again is unlikely to
make it more zero.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pingc@wacom.com>
2017-03-23 10:18:09 +10:00
Peter Hutterer
3afe8bc914 touchpad: add touchpad pressure state debugging to debug output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-23 10:17:07 +10:00
Peter Hutterer
2d243cc8a9 configure.ac: libinput 1.7.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-23 09:16:01 +10:00
Peter Hutterer
25b14e1335 evdev: mark the new log functions as printf-style functions
And fix up the one buggy call we had

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-23 07:30:08 +10:00
Peter Hutterer
17e9dfd0d1 touchpad: add pressure ranges for cyapa touchpads
https://bugs.freedesktop.org/show_bug.cgi?id=100122

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-03-23 07:29:36 +10:00
Peter Hutterer
e3d04088bd tools: print axes, but not capabilities on proximity out
Print the axis values on proximity out because it a) ensures we have the right
values and b) makes the output better aligned with the proximity in, so it's
easier to spot in a log file. But don't print the tool capabilities because
they're unrelated to the prox out anyway and again it makes the output easier
to spot.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-22 10:48:43 +10:00
Peter Hutterer
eb8cfa301a test: add missing linebreak to error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-14 12:33:15 +10:00
Peter Hutterer
bb4f90de0b test: fix tablet touch arbitration case
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-14 12:33:15 +10:00
Peter Hutterer
c2b33f2a53 test: don't use the same mouse twice
No effect since we don't care about the mouse itself. But when running
on kernels without uinput's UI_GET_SYSNAME this can cause misdetection of
the uinput device and test case failures. Simply picking a differently named
device avoids that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-14 12:33:15 +10:00
Peter Hutterer
c05e92643c configure.ac: libinput 1.7rc2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-10 06:19:37 +10:00
Peter Hutterer
592483b800 configure.ac: set AC_CONFIG_AUX_DIR
If not set, libtool will search directories up to ../.. for an install-sh and
then dump the aux files there. This caused a couple of problems with the xorg
release.sh script that now uses worktrees but is generally bad behaviour
because we can't guarantee that we're not inside some other repository.

Set AC_CONFIG_AUX_DIR to avoid this behavior.

See https://lists.freedesktop.org/archives/xorg-devel/2017-March/053006.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-03-10 06:19:31 +10:00
Peter Hutterer
e6342d409e doc: expand on the default tap settings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-09 14:03:22 +10:00
Peter Hutterer
b51546314f test: drop ABS_MT_PRESSURE from the bcm5974
This device only sends ABS_PRESSURE

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-08 14:44:26 +10:00
Peter Hutterer
bb3d6e000e doc: expand build instructinos
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-08 14:36:56 +10:00
Peter Hutterer
957f8ec2f1 touchpad: add elantech-specific pressure values
https://bugs.freedesktop.org/show_bug.cgi?id=99975

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-03-08 06:49:38 +10:00
Peter Hutterer
c0dbd6eb38 touchpad: ignore hovering touches for the software button state
If a touch started hovering in the main area, the button state would start
with AREA and never move to the real button state, despite the finger
triggering the pressure thresholds correctly in one of the areas.

This could even happen across touch sequences if a touch went below pressure
in the software button area, it changed to hovering and the button state
changed to NONE. On the next event, the touch is still hovering and the
current position of the touch is taken for the button state machine.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-03-02 08:34:17 +10:00
Peter Hutterer
07ce6c8954 tools: fix printing of tablet coordinates
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-03-01 09:34:46 +10:00
Peter Hutterer
d6379bc3f3 touchpad: reduce minimum height for horiz edge scrolling to 40mm
Introduced in commit 8e7f99c27a we only allowed horizontal edge scrolling
on devices larger than 50mm to leave enough reactive space on the touchpad.
Looking at a ruler, a 50mm high touchpad is still large enough to leave the
bottom 7mm as an horizontal edge scroll area. Reduce the minimum size to 40mm
instead, that's closer to where it starts to get a bit iffy.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-28 11:32:08 +10:00
Peter Hutterer
1798cbdcaa tools: fix two comment typos
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-27 15:24:09 +10:00
Peter Hutterer
619db3b60e Merge branch 'wip/log-function-rework' 2017-02-27 11:27:41 +10:00
Peter Hutterer
38c675c959 tools: add mode group info to libinput-list-devices
We don't cater for the special case of groups having a different number of
modes, there is no hardware right now that does that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-27 09:36:37 +10:00
Peter Hutterer
c787ccf270 Fix a crash when requesting invalid mode group indices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-02-27 09:36:37 +10:00
Peter Hutterer
451c6913e5 tools: add "--quiet" option to only log libinput messages
Supresses any printf statements from the tool itself, i.e. it skips printing
any of the events.

Makes it easier to debug the internal state since it's not intermixed with a
whole lot of messages about the events that are generated. Best combined with
--verbose (yes, hilarious, isn't it...)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
2017-02-24 16:11:46 +10:00
Peter Hutterer
faf86d3e37 timer: prefix all messages with "timer:"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
2017-02-24 16:04:44 +10:00
Peter Hutterer
6181adbdcd evdev: standardize log messsages
Prefix device log messages with the device's sysname so it's more obvious
where the messages are coming from. This makes it much easier to grep for a
specific device's messages but also adds some identifier to messages that
were previously without any identifier (e.g. all the state machine debugging)

All info and error messages also automatically prefix the device name, so
those messages are standardised too, e.g

an info message now:
  event4  - SynPS/2 Synaptics TouchPad: is tagged by udev as: Touchpad
a debug message now:
  event4  - using pressure-based touch detection

And since this required changing a lot of the strings in messages anyway,
polish a few minor things too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
2017-02-24 16:04:44 +10:00
Peter Hutterer
2d500deac8 evdev: move the 'device removed' message to the evdev backend
Preparation work for standardizing log messages better

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
2017-02-24 15:54:56 +10:00
Peter Hutterer
67a7026b74 configure.ac: libinput 1.7rc1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-23 10:49:11 +10:00
Peter Hutterer
fd67204cf2 doc: add a custom css for local overrides
Easier to track if we leave the original files alone. Actual changes to the
doxygen style:

* indent <dd> blocks
* hide the navigation sub-items. Our current style expands the full navigation
  menu but File-list, etc. is mostly useless and just wastes space.
* force some space below the main bar
* change the header sizes around a bit. Primary goal here: making <h1> smaller
  than the title

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-23 08:20:20 +10:00
Peter Hutterer
8a79d8a487 doc: allow custom styles to overide the bootstrap style
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-02-23 08:19:37 +10:00