platform/upstream/libinput.git
8 years agotools: reduce some spacing to compress the output a bit
Peter Hutterer [Tue, 3 Jan 2017 00:12:32 +0000 (10:12 +1000)]
tools: reduce some spacing to compress the output a bit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: align device notify output better
Peter Hutterer [Tue, 3 Jan 2017 00:03:47 +0000 (10:03 +1000)]
tools: align device notify output better

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: size in mm is enough, no need for sub-mm precision here
Peter Hutterer [Tue, 3 Jan 2017 00:01:06 +0000 (10:01 +1000)]
tools: size in mm is enough, no need for sub-mm precision here

Also changes from W/H to WxH format

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: add allowed range to --set-speed help output
Peter Hutterer [Mon, 2 Jan 2017 21:58:18 +0000 (07:58 +1000)]
tools: add allowed range to --set-speed help output

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: add test for the vertical position-dependent pinch
Peter Hutterer [Tue, 20 Dec 2016 23:44:27 +0000 (09:44 +1000)]
test: add test for the vertical position-dependent pinch

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agogestures: if fingers don't move, force a gesture by finger position
Peter Hutterer [Tue, 20 Dec 2016 00:36:37 +0000 (10:36 +1000)]
gestures: if fingers don't move, force a gesture by finger position

If the fingers rest on the touchpad without moving for a timeout, switch to
pinch or swipe based on the finger position. We already switched to two-finger
scrolling based on the timeout, now we also do so for 3 and 4 finger gestures.
This gives us better reaction to small movements.

This also fixes previously unreachable code: the test for the finger position
required at least 3 fingers down but was within a condition that ensured only
2 fingers were down. This was introduced in 11917061fe320c.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: ignore MSC_SCAN
Peter Hutterer [Tue, 13 Sep 2016 23:43:39 +0000 (09:43 +1000)]
tablet: ignore MSC_SCAN

Sent by some HUION tablets

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: reduce the tap movement threshold to 1.3mm
Peter Hutterer [Fri, 2 Dec 2016 01:45:44 +0000 (11:45 +1000)]
touchpad: reduce the tap movement threshold to 1.3mm

When a finger moves less than the movement threshold, motion is filtered until
the timeout is hit. If the threshold is too high the responsiveness of the
pointer suffers.

Event analysis from several users showed that 95% of the touches move less
than 1.3mm long. Reducing the threshold should have almost no impact on most
tapping users but improves the reaction time of the pointer for normal
movements.

For a more details see:
http://who-t.blogspot.com/2016/12/libinput-touchpad-tap-analysis.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: reduce the initial timeout for tapping after touch
Peter Hutterer [Fri, 2 Dec 2016 01:35:51 +0000 (11:35 +1000)]
touchpad: reduce the initial timeout for tapping after touch

This is the timeout before we decide "this is just a finger down, not a tap".
Until this timeout is hit a finger's movement is filtered. To allow for a more
responsive touchpad, we want that timeout as short as possible.

Event analysis from several users showed that 95% of the touches are less than
100ms long. Reducing the threshold should have almost no impact on most
tapping users but improves the reaction time of the pointer for normal
movements.

For a more details see:
http://who-t.blogspot.com/2016/12/libinput-touchpad-tap-analysis.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoMerge branch 'touchpad-pointer-accel-revamp'
Peter Hutterer [Wed, 21 Dec 2016 01:34:37 +0000 (11:34 +1000)]
Merge branch 'touchpad-pointer-accel-revamp'

8 years agofilter: tweak the magic slowdown
Peter Hutterer [Wed, 14 Dec 2016 09:51:13 +0000 (19:51 +1000)]
filter: tweak the magic slowdown

Could be confirmation bias, but it feels better.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agodoc: update the touchpad pointer acceleration svg
Peter Hutterer [Mon, 19 Dec 2016 02:18:42 +0000 (12:18 +1000)]
doc: update the touchpad pointer acceleration svg

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: revamp the touchpad's acceleration code
Peter Hutterer [Wed, 14 Dec 2016 09:40:18 +0000 (19:40 +1000)]
filter: revamp the touchpad's acceleration code

The previous code had three main issues:
* acceleration kicked in too early, so even slow movements were accelerated
* acceleration kicked in too quickly, there was only a very narrow window
  where we would have less than the max acceleration factor
* the max accel factor was too low for fast movements, so they still fell
  short of expectations

This patch revamps most of the acceleration though it keeps the basic shape of
the acceleration curve.

* The threshold is increased significantly so that faster movement
  still map to the finger movement. Acceleration doesn't kick in until we get
  to something that's really fast like a flick.
* The incline is dropped, so acceleration kicks in slower than before, i.e.
  the difference between the first speed that is accelerated and the speed
  that reaches the maximum is higher than before.
* The maximum acceleration is increased so ever faster movements get ever
  faster. The max is effectively out of reach now, if you move fast enough to
  hit this speed, your cursor will end up on the moon anyway.

A couple of other changes apply now too, specifically:
* The incline remains the same regardless of the speed
* The max accel factor remains the same regardless of the speed

The caculated factor changes with the speed set so that the base speed changes
with the desired speed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotools: switch the ptraccel-debug printf to use mm/s
Peter Hutterer [Thu, 15 Dec 2016 22:22:54 +0000 (08:22 +1000)]
tools: switch the ptraccel-debug printf to use mm/s

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: work the touchpad magic slowdown into the various parameters
Peter Hutterer [Thu, 15 Dec 2016 06:23:57 +0000 (16:23 +1000)]
filter: work the touchpad magic slowdown into the various parameters

We have everything separate from the mouse now, so having a magic slowdown
isn't needed, we can work this into our parameters. So the acceleration
function now uses everything adjusted, but the factor is still multiplied by
the slowdown in the end.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: change touchpad accel code to use mm/s
Peter Hutterer [Thu, 15 Dec 2016 04:15:22 +0000 (14:15 +1000)]
filter: change touchpad accel code to use mm/s

That's something human brains can map to because mapping a touchpad to
equivalent units of a 1000dpi mouse requires a lot of mental acrobatics. And
I'm getting older and my physio told me acrobatics is more something for the
youngens, possibly those on my lawn listening to terrible music, etc.

The various numbers are converted either times 25.4/1000 or times 1000/25.4,
depending on the usage. Somewhere I made a mistake or a rounding error or
something, so the acceleration curve is not exactly the same, but it's close
enough that it shouldn't matter. The difference shows up in a gnuplot of the
curve but it may not even perceivable anyway. And these values will be
overhauled soon anyway, so meh.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: drop the now-generic trackpoint and low-dpi filter functions
Peter Hutterer [Thu, 15 Dec 2016 01:26:52 +0000 (11:26 +1000)]
filter: drop the now-generic trackpoint and low-dpi filter functions

The profile is what is still special about those two, the filter itself does
the same as the default filter (calculate velocity, calculate accel factor,
apply to delta).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: change the filter functions to take raw device coordinates
Peter Hutterer [Wed, 14 Dec 2016 22:36:22 +0000 (08:36 +1000)]
filter: change the filter functions to take raw device coordinates

We used to normalize all deltas to equivalents of a 1000dpi mouse before
passing it into the acceleration functions. This has a bunch of drawbacks, not
least that we already have to un-normalize back into device units for a few
devices already (trackpoints, tablet, low-dpi mice).

Switch the filter code over to use device units, relying on the dpi set
earlier during filter creation to convert to normalized. To make things easy,
the output of the filter code is still normalized data, i.e. data ready to be
handed to the libinput caller.

No effective functional changes. For touchpads, we still send normalized
coordinates (for now, anyway). For the various filter methods, we either drop
the places where we unnormalized before or we normalize where needed.

Two possible changes: for trackpoints and low-dpi mice we had a max dpi factor
of 1.0 before - now we don't anymore. This was only the case if a low-dpi
mouse had more than 1000dpi (never true) or a trackpoint had a const accel
lower than 1.0 (yeah, whatever).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoAdd device_float_get_direction
Peter Hutterer [Wed, 14 Dec 2016 23:26:42 +0000 (09:26 +1000)]
Add device_float_get_direction

With some upcoming changes we need this function for device float coordinates
as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: init the device's dpi correctly
Peter Hutterer [Thu, 15 Dec 2016 02:45:38 +0000 (12:45 +1000)]
touchpad: init the device's dpi correctly

This has no real effect just yet because we don't use a touchpad's dpi
anywhere in the touchpad code. Only the acceleration code wants it but all
touchpads use the same acceleration method, and that one doesn't care about
the dpi.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: duplicate pointer accel for touchpads
Peter Hutterer [Mon, 14 Nov 2016 06:47:26 +0000 (16:47 +1000)]
filter: duplicate pointer accel for touchpads

This duplicates the code so we can change it for touchpads without affecting
mice.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: drop the dpi_factor in favor of direct calculation
Peter Hutterer [Thu, 15 Dec 2016 00:51:16 +0000 (10:51 +1000)]
filter: drop the dpi_factor in favor of direct calculation

This was badly since the factor was the ratio of "dpi:default dpi"

Most devices don't need it, so storing it in all filters event though we only
use it for some devices is confusing. Now that we have the dpi stored
directlyconfusing. Now that we have the dpi stored directly we might as well
use that.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: store the raw dpi value in the filter
Peter Hutterer [Wed, 14 Dec 2016 23:22:23 +0000 (09:22 +1000)]
filter: store the raw dpi value in the filter

Currently unused, will be used in the future.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: change direction flags from int to uint32_t
Peter Hutterer [Tue, 20 Dec 2016 00:51:09 +0000 (10:51 +1000)]
touchpad: change direction flags from int to uint32_t

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: if an external touchpad and keyboard share a VID/PID assume dwt
Peter Hutterer [Mon, 19 Dec 2016 05:36:34 +0000 (15:36 +1000)]
touchpad: if an external touchpad and keyboard share a VID/PID assume dwt

This requires to expand the blacklisting to be a bit more specific so we don't
initialize dwt config on devices that won't need it.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: use the udev property to check for external/internal touchpads
Peter Hutterer [Mon, 19 Dec 2016 21:31:27 +0000 (07:31 +1000)]
test: use the udev property to check for external/internal touchpads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: mark the magic trackpad as external in udev
Peter Hutterer [Mon, 19 Dec 2016 21:22:27 +0000 (07:22 +1000)]
test: mark the magic trackpad as external in udev

This should be handled by a udev rule in systemd/hwdb but that rule doesn't
apply to virtual devices.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: don't set LITEST_VERBOSE during make check
Peter Hutterer [Mon, 19 Dec 2016 22:52:19 +0000 (08:52 +1000)]
test: don't set LITEST_VERBOSE during make check

I've never had the log output help me identify a bug during a test run. Now
that we run all tests in the same binary the verbosity just leads to a massive
file that makes it hard to find the actual failure. Turn off LITEST_VERBOSE by
default but leave the parsing in for cases where it may come in handy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: fix comment on how we calculate the slow-motion incline
Peter Hutterer [Thu, 15 Dec 2016 06:30:15 +0000 (16:30 +1000)]
filter: fix comment on how we calculate the slow-motion incline

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoChange the directions bitmask to a uin32_t
Peter Hutterer [Thu, 15 Dec 2016 02:16:28 +0000 (12:16 +1000)]
Change the directions bitmask to a uin32_t

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agofilter: fix a comment, the trackpoint profile uses device units
Peter Hutterer [Thu, 15 Dec 2016 01:03:03 +0000 (11:03 +1000)]
filter: fix a comment, the trackpoint profile uses device units

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: rename a leftover weston variable
Peter Hutterer [Wed, 14 Dec 2016 21:27:45 +0000 (07:27 +1000)]
evdev: rename a leftover weston variable

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agofilter: add a comment for how we calculate velocity
Peter Hutterer [Tue, 13 Dec 2016 05:31:27 +0000 (15:31 +1000)]
filter: add a comment for how we calculate velocity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agofilter: split a condition up so we can mark it as bug
Peter Hutterer [Tue, 13 Dec 2016 05:28:29 +0000 (15:28 +1000)]
filter: split a condition up so we can mark it as bug

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: convert two functions to use the device->phys helpers
Peter Hutterer [Tue, 13 Dec 2016 00:01:02 +0000 (10:01 +1000)]
touchpad: convert two functions to use the device->phys helpers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: constify a few helper functions
Peter Hutterer [Mon, 12 Dec 2016 23:54:30 +0000 (09:54 +1000)]
touchpad: constify a few helper functions

May help the compiler with further optimization

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: add some extra help output about the expected input data
Peter Hutterer [Mon, 14 Nov 2016 06:50:55 +0000 (16:50 +1000)]
tools: add some extra help output about the expected input data

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: whitespace change
Peter Hutterer [Mon, 14 Nov 2016 06:33:31 +0000 (16:33 +1000)]
tools: whitespace change

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: local headers use quotes, not pointy brackets
Peter Hutterer [Mon, 14 Nov 2016 06:32:16 +0000 (16:32 +1000)]
tools: local headers use quotes, not pointy brackets

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: up the maximum velocity so the output graph shows the leveling off
Peter Hutterer [Wed, 2 Nov 2016 01:22:35 +0000 (11:22 +1000)]
tools: up the maximum velocity so the output graph shows the leveling off

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: support --help in the ptraccel-debug tool
Peter Hutterer [Wed, 2 Nov 2016 01:19:28 +0000 (11:19 +1000)]
tools: support --help in the ptraccel-debug tool

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix distcheck
Peter Hutterer [Wed, 7 Dec 2016 00:28:40 +0000 (10:28 +1000)]
test: fix distcheck

Broken in e0b200caa60830

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: make sure GCC_FLAGS is used in tools/
Peter Hutterer [Mon, 5 Dec 2016 10:29:51 +0000 (20:29 +1000)]
tools: make sure GCC_FLAGS is used in tools/

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: include config.h in libinput-list-devices and ptraccel-debug
Peter Hutterer [Mon, 5 Dec 2016 10:56:23 +0000 (20:56 +1000)]
tools: include config.h in libinput-list-devices and ptraccel-debug

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: fix comment wording
Peter Hutterer [Mon, 5 Dec 2016 21:10:39 +0000 (07:10 +1000)]
tools: fix comment wording

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: fix signed/unsigned comparison warnings
Peter Hutterer [Mon, 5 Dec 2016 10:31:31 +0000 (20:31 +1000)]
tools: fix signed/unsigned comparison warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: fix prototype for tools_usage
Peter Hutterer [Mon, 5 Dec 2016 05:31:37 +0000 (15:31 +1000)]
tools: fix prototype for tools_usage

../tools/shared.h:66:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
void tools_usage();

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: sync BTN_TOOL_FINGER state on init
Peter Hutterer [Mon, 5 Dec 2016 03:39:42 +0000 (13:39 +1000)]
touchpad: sync BTN_TOOL_FINGER state on init

The Elantech touchpad on my Asus Vivobook doesn't release BTN_TOOL_FINGER on
up. If the touchpad was used before libinput initializes, the kernel filters
the event because its state is already set. We never receive it and keep
ignoring all events until the first switch to BTN_TOOL_DOUBLETAP and back.

On touchpad init sync the BTN_TOOL_FINGER state and set it accordingly. This
is the only event that can be legitimately down on init. We don't care about
BTN_TOUCH because ignoring an ongoing touch on init is generally a good idea
and we can ignore any multifinger gesture as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoWhitespace fixes
Peter Hutterer [Mon, 5 Dec 2016 04:21:34 +0000 (14:21 +1000)]
Whitespace fixes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoFix the license for a bunch of tablet test devices
Peter Hutterer [Thu, 1 Dec 2016 01:12:09 +0000 (11:12 +1000)]
Fix the license for a bunch of tablet test devices

In bc9f16b40e23a1d25c105a4207b97d65253f0d98 the license was updated from MIT
X11 to MIT Expat, see that commit for details.

These devices came in from the tablet-support branch which didn't get
updated, any new tablet device that used those as templated thus copied the
license. Fix this, make the license text the same as all other files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
8 years agoDrop HAVE_CONFIG_H ifdef
Peter Hutterer [Wed, 30 Nov 2016 08:12:39 +0000 (18:12 +1000)]
Drop HAVE_CONFIG_H ifdef

We have one. Yay. Lucky us. Go forth and celebrate.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
8 years agotools: don't define GNU_SOURCE if were including config.h anyway
Peter Hutterer [Wed, 30 Nov 2016 07:53:00 +0000 (17:53 +1000)]
tools: don't define GNU_SOURCE if were including config.h anyway

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
8 years agoUse the LIBINPUT_VERSION define, not the normal VERSION
Peter Hutterer [Wed, 30 Nov 2016 07:49:52 +0000 (17:49 +1000)]
Use the LIBINPUT_VERSION define, not the normal VERSION

Not that it really matters, but given we're already setting it anyway...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
8 years agotouchpad: add a quirk for the HP Pavilion dm4
Peter Hutterer [Tue, 1 Nov 2016 23:40:42 +0000 (09:40 +1000)]
touchpad: add a quirk for the HP Pavilion dm4

This touchpad has cursor jumps for 2-finger scrolling that also affects the
single-finger emulation. So disable any multitouch bits on this device and
disallow the 2-finger scroll method. This still allows for 2-finger
tapping/clicking.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: init axis range warnings for touch devices too
Peter Hutterer [Mon, 28 Nov 2016 04:58:18 +0000 (14:58 +1000)]
evdev: init axis range warnings for touch devices too

Move the code from the touchpad code into the more generic evdev code

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotools: print pointer axis source in event-debug
Peter Hutterer [Mon, 28 Nov 2016 01:00:00 +0000 (11:00 +1000)]
tools: print pointer axis source in event-debug

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: change --speed to --set-speed for consistency
Peter Hutterer [Fri, 14 Oct 2016 01:41:43 +0000 (11:41 +1000)]
tools: change --speed to --set-speed for consistency

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotablet: reject tablets without resolution
Peter Hutterer [Fri, 4 Nov 2016 02:50:35 +0000 (12:50 +1000)]
tablet: reject tablets without resolution

Fix the kernel driver or get a udev override in place. Tablets not having a
physical size is not ok.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoutil: tighten requirements on the click angle/count properties
Peter Hutterer [Thu, 3 Nov 2016 02:34:35 +0000 (12:34 +1000)]
util: tighten requirements on the click angle/count properties

Require both of them to be an integer, don't allow for a list or preceding
whitespaces.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: use safe_atod to convert the matrix values
Peter Hutterer [Fri, 25 Nov 2016 06:27:17 +0000 (16:27 +1000)]
evdev: use safe_atod to convert the matrix values

Avoids parsing issues when we're in different locales

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoutil: add a helper function to split a string into substrings
Peter Hutterer [Fri, 25 Nov 2016 06:12:10 +0000 (16:12 +1000)]
util: add a helper function to split a string into substrings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoutil: add safe_atod for locale-independent conversion
Peter Hutterer [Thu, 24 Nov 2016 00:51:26 +0000 (10:51 +1000)]
util: add safe_atod for locale-independent conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: add a device and test for udev-set calibration values
Peter Hutterer [Fri, 25 Nov 2016 04:59:27 +0000 (14:59 +1000)]
test: add a device and test for udev-set calibration values

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agopath: read the calibration prop on startup
Peter Hutterer [Fri, 25 Nov 2016 03:58:39 +0000 (13:58 +1000)]
path: read the calibration prop on startup

We were reading this property in the udev backend, but not in the path
backend.

Reported-by: Thomas Olszak <olszak.tomasz@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: move reading the calibration prop into a helper function
Peter Hutterer [Fri, 25 Nov 2016 03:54:35 +0000 (13:54 +1000)]
evdev: move reading the calibration prop into a helper function

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: add a test for safe_atoi
Peter Hutterer [Thu, 24 Nov 2016 01:20:43 +0000 (11:20 +1000)]
test: add a test for safe_atoi

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: switch asserts to litest_assert
Peter Hutterer [Fri, 25 Nov 2016 04:56:52 +0000 (14:56 +1000)]
test: switch asserts to litest_assert

Gives us a stacktrace when it fails.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoutil: if errno is nonzero, exit early from safe_atoi
Peter Hutterer [Thu, 24 Nov 2016 00:48:39 +0000 (10:48 +1000)]
util: if errno is nonzero, exit early from safe_atoi

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoutil: fix include order
Peter Hutterer [Thu, 24 Nov 2016 00:51:05 +0000 (10:51 +1000)]
util: fix include order

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoutil: fix indentation for safe_atoi
Peter Hutterer [Thu, 24 Nov 2016 00:47:47 +0000 (10:47 +1000)]
util: fix indentation for safe_atoi

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agolibinput 1.5.2 1.5.2
Peter Hutterer [Fri, 25 Nov 2016 01:02:13 +0000 (11:02 +1000)]
libinput 1.5.2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: only use the last two coordinates for delta calculation
Peter Hutterer [Sun, 20 Nov 2016 22:39:47 +0000 (08:39 +1000)]
touchpad: only use the last two coordinates for delta calculation

Taking the last 4 points means factoring in a coordinate that may be more than
40ms in the past - or even more when the finger moves slowly and we don't get
events for a while. This makes the pointer more sluggish and slower to catch up
with what the finger is actually doing.

We already have the motion hysteresis as a separate item to prevent jumps (and
thus adds some delay to the movement), the calculation over time doesn't
provide enough benefit to justify the sluggish pointer.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agodoc: remove unnecessary linebreak in doxygen file
Peter Hutterer [Wed, 23 Nov 2016 00:38:45 +0000 (10:38 +1000)]
doc: remove unnecessary linebreak in doxygen file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: simplify hysteresis code and document it
Peter Hutterer [Mon, 21 Nov 2016 02:24:45 +0000 (12:24 +1000)]
evdev: simplify hysteresis code and document it

center + diff is the input coordinate. Simplify the code so it's clear what
we're returning. And document the function to explain what it does.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: allow the first event to be a short one during scroll tests
Peter Hutterer [Mon, 21 Nov 2016 04:10:10 +0000 (14:10 +1000)]
test: allow the first event to be a short one during scroll tests

The hysteresis cuts the first pointer motion by the hysteresis margin. On some
touchpads this causes the tests to fail when the motion history length is
reduced (future patch). Allow the first event to be smaller than the expected
minimum.

This doesn't trigger in current tests because the hysteresis is per-event and
by the time we get past the minimum 4 events to move the pointer, we're
already flying unaffected by the hysteresis.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: fix edge-scroll no-motion test
Peter Hutterer [Mon, 21 Nov 2016 04:33:30 +0000 (14:33 +1000)]
test: fix edge-scroll no-motion test

The test is supposed to make sure no motion event is sent and that scrolling
continues once leaving the edge. It does so by moving down the edge, into the
touchpad, then down further. The move from the edge into the touchpad had a
vertical component to it though and could cause the scroll minimum test to
fail. This is currently covered up by the delta calculations though, but fix
it anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: start with the first offset when moving touches
Peter Hutterer [Mon, 21 Nov 2016 01:03:58 +0000 (11:03 +1000)]
test: start with the first offset when moving touches

This doesn't have an effect in our current tests because the touchpad always
needs 4 motion events to get moving. But for the future, it simplifies the
case of "i want to move between x1/y1 and x2/y2", because it fills in only the
events in between rather than re-using the touch down coordinates and thus not
causing a motion on the first event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoudev: move TEST_EXTENSIONS out of the conditional
Peter Hutterer [Tue, 22 Nov 2016 01:09:02 +0000 (11:09 +1000)]
udev: move TEST_EXTENSIONS out of the conditional

Fixes:
udev/Makefile.am:47: warning: 'TEST_EXTENSIONS' cannot have conditional
contents

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: fix maybe-uninitialized compiler warnings
Peter Hutterer [Tue, 22 Nov 2016 00:59:18 +0000 (10:59 +1000)]
test: fix maybe-uninitialized compiler warnings

touchpad-tap.c: In function ‘touchpad_3fg_tap_btntool_inverted’:
touchpad-tap.c:1548:2: warning: ‘button’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
and similar

False positive, if button isn't set by now we would've abort()-ed before we
even get here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotest: mark the various abort functions as noreturn
Peter Hutterer [Tue, 22 Nov 2016 00:57:01 +0000 (10:57 +1000)]
test: mark the various abort functions as noreturn

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: add a quirk for the HP Zbook Studio G3
Peter Hutterer [Thu, 13 Oct 2016 09:05:00 +0000 (19:05 +1000)]
evdev: add a quirk for the HP Zbook Studio G3

Announces 4 slots but only sends data for the first two. This causes libinput
to miss three-finger actions (we don't look at BTN_TOOL_TRIPLETAP if we have
3 or more slots).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoUse AM_DISTCHECK_CONFIGURE_FLAGS, not just DISTCHECK_CONFIGURE_FLAGS
Peter Hutterer [Tue, 15 Nov 2016 05:09:00 +0000 (15:09 +1000)]
Use AM_DISTCHECK_CONFIGURE_FLAGS, not just DISTCHECK_CONFIGURE_FLAGS

The latter is for commandline overrides.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoDisable test runs on 'distcheck'
Peter Hutterer [Sun, 13 Nov 2016 23:35:56 +0000 (09:35 +1000)]
Disable test runs on 'distcheck'

The tests require the creation of udev devices which in turn require root and
usually cause distcheck runs to fail. Add a new option to disable the
*running* of tests at distcheck (we still want to build them).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoconfigure.ac: move the udev test path up into the test section
Peter Hutterer [Mon, 14 Nov 2016 00:05:41 +0000 (10:05 +1000)]
configure.ac: move the udev test path up into the test section

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoconfigure.ac: add some comment markers to see the configure.ac sections easier
Peter Hutterer [Mon, 14 Nov 2016 00:04:12 +0000 (10:04 +1000)]
configure.ac: add some comment markers to see the configure.ac sections easier

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoconfigure.ac: move all AM_CONDITIONALs into one place
Peter Hutterer [Sun, 13 Nov 2016 23:51:46 +0000 (09:51 +1000)]
configure.ac: move all AM_CONDITIONALs into one place

Makes it easier to see in one go what is conditional in the build.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoconfigure.ac: libinput 1.5.1 1.5.1
Peter Hutterer [Fri, 11 Nov 2016 03:49:27 +0000 (13:49 +1000)]
configure.ac: libinput 1.5.1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: fix typo / bugzilla url
Hermann Gausterer [Wed, 9 Nov 2016 15:58:07 +0000 (16:58 +0100)]
evdev: fix typo / bugzilla url

Signed-off-by: Hermann Gausterer <git-libinput-2016@mrq1.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: implement support for the MOUSE_WHEEL_CLICK_COUNT property
Peter Hutterer [Fri, 28 Oct 2016 05:08:32 +0000 (15:08 +1000)]
evdev: implement support for the MOUSE_WHEEL_CLICK_COUNT property

Not all mice have a click angle with integer degrees. The new
MOUSE_WHEEL_CLICK_COUNT property specifies how many clicks per full rotation,
the angle can be calculated from that.

See https://github.com/systemd/systemd/pull/4440 for more information

CLICK_COUNT overrides CLICK_ANGLE, so we check for the former first and then
fall back to the angle if need be. No changes to the user-facing API.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: expand trackpoint pointer acceleration documentation a bit
Peter Hutterer [Thu, 3 Nov 2016 04:01:17 +0000 (14:01 +1000)]
doc: expand trackpoint pointer acceleration documentation a bit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: add hwdb quirk for HP Compaq 6910
Peter Hutterer [Wed, 2 Nov 2016 11:11:00 +0000 (21:11 +1000)]
evdev: add hwdb quirk for HP Compaq 6910

Same as the HP Compat 8510, it doesn't send BTN_TOOL_DOUBLETAP/TRIPLETAP. This
may be a general issue with those series but they're 6 years old now, so
it's questionable to spend extra effort detecting them.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoevdev: actually ignore joysticks
Peter Hutterer [Wed, 2 Nov 2016 00:45:39 +0000 (10:45 +1000)]
evdev: actually ignore joysticks

A joystick has ID_INPUT_JOYSTICK *and* ID_INPUT set, so we need to check for
both.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoudev: add the hwdb_parser.py test from systemd
Peter Hutterer [Tue, 13 Sep 2016 06:57:25 +0000 (16:57 +1000)]
udev: add the hwdb_parser.py test from systemd

upstream for this file lives in systemd, any changes to the actual parser
should flow back there.

libinput's matches are fairly simple. We have the various LIBINPUT_MODEL_ tags
that just take a "1" and the two attributes that are dimensions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoMove touch_notify_frame declaration to the other touch functions
Peter Hutterer [Mon, 4 Jan 2016 00:55:37 +0000 (10:55 +1000)]
Move touch_notify_frame declaration to the other touch functions

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agoAdd missing event type checks to libinput_event_gesture_get_base_event
Peter Hutterer [Mon, 4 Jan 2016 00:49:23 +0000 (10:49 +1000)]
Add missing event type checks to libinput_event_gesture_get_base_event

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: check for trackpoint/keyboard at the top of the helpers
Peter Hutterer [Mon, 4 Jan 2016 00:00:03 +0000 (10:00 +1000)]
touchpad: check for trackpoint/keyboard at the top of the helpers

No functional changes, just to filter out devices that don't match
immediately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotouchpad: split the touchpad->keyboard/trackpoint pairing helpers out
Peter Hutterer [Sun, 3 Jan 2016 23:58:36 +0000 (09:58 +1000)]
touchpad: split the touchpad->keyboard/trackpoint pairing helpers out

No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: add missing comma to horizontal click angle udev rule
Peter Hutterer [Tue, 25 Oct 2016 02:09:54 +0000 (12:09 +1000)]
test: add missing comma to horizontal click angle udev rule

Without the comma it now assigns the horizontal click angle property to all
devices.

Introduced in b02acd346b

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoevdev: add missing space in error message
Peter Hutterer [Tue, 25 Oct 2016 00:44:00 +0000 (10:44 +1000)]
evdev: add missing space in error message

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: add a small page about contributing to libinput
Peter Hutterer [Fri, 14 Oct 2016 04:22:14 +0000 (14:22 +1000)]
doc: add a small page about contributing to libinput

To be expanded at some future time...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>