platform/upstream/libinput.git
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 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>
8 years agotest: fix clang warning about abs(float)
Peter Hutterer [Mon, 24 Oct 2016 01:31:28 +0000 (11:31 +1000)]
test: fix clang warning about abs(float)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agotouchpad: switch from fabs() to abs()
Peter Hutterer [Mon, 24 Oct 2016 01:04:18 +0000 (11:04 +1000)]
touchpad: switch from fabs() to abs()

silence clang warning:
evdev-mt-touchpad.c:1017:7: warning: using floating point absolute value
function 'fabs' when argument is of integer type [-Wabsolute-value]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agoMark some internal log functions as printf-style function
Peter Hutterer [Mon, 24 Oct 2016 01:06:23 +0000 (11:06 +1000)]
Mark some internal log functions as printf-style function

Fixes the respective clang warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
8 years agodoc: reshuffle the "reporting bugs" page
Peter Hutterer [Tue, 18 Oct 2016 23:52:21 +0000 (09:52 +1000)]
doc: reshuffle the "reporting bugs" page

Split it into several device-specific sections

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: change pointer to void
Eric Engestrom [Thu, 15 Sep 2016 10:33:49 +0000 (11:33 +0100)]
tools: change pointer to void

This makes it clear that it's not meant to be dereferenced.

CC: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: specify the https path for mathjax
Peter Hutterer [Wed, 14 Sep 2016 00:18:16 +0000 (10:18 +1000)]
doc: specify the https path for mathjax

freedesktop.org always serves https for the documentation. if Mathjax is
pulled in from http, browsers reject it [1]

Let's take the default doxygen value but just add the https to it. In the
future we should just ship a copy of mathjax with our documentation.

[1] https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content/How_to_fix_website_with_mixed_content

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Wheres-my-beer-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
8 years agoconfigure.ac: libinput 1.5.0 1.5.0
Peter Hutterer [Wed, 14 Sep 2016 04:49:55 +0000 (14:49 +1000)]
configure.ac: libinput 1.5.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoudev: fix hwdb match for the HP Stream 11
Peter Hutterer [Wed, 14 Sep 2016 01:21:55 +0000 (11:21 +1000)]
udev: fix hwdb match for the HP Stream 11

prefix must be libinput, not evdev

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotouchpad: require at least 3 events before enabling trackpoint palm detection
Peter Hutterer [Tue, 6 Sep 2016 22:18:33 +0000 (08:18 +1000)]
touchpad: require at least 3 events before enabling trackpoint palm detection

Some trackpoints, notably the one on the Lenovo T460s have a tendency to send
the odd event even when they're not actually used. Trackpoint events trigger
palm detection (see 0210f1fee193) and thus effectively disable the touchpad,
causing the touchpad to appear nonresponsive.

Fix this by requiring at least 3 events from a trackpoint before palm
detection is enabled. For normal use it's hard enough to trigger a single
event anyway so this should not affect the normal use-case.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotest: rename SYNAPTICS_CLICKPAD to SYNAPTICS_CLICKPAD_X220
Peter Hutterer [Fri, 9 Sep 2016 02:54:01 +0000 (12:54 +1000)]
test: rename SYNAPTICS_CLICKPAD to SYNAPTICS_CLICKPAD_X220

That's where this device comes from. The x220 is special because it's too
small to trigger some of the features, eg. palm detection. Make this more
obvious by changing to a less generic name.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agotools: prefix debug output with '-' on device changes
Peter Hutterer [Thu, 8 Sep 2016 05:55:47 +0000 (15:55 +1000)]
tools: prefix debug output with '-' on device changes

We print the sysname, but it's not always obvious when there's an event from
another device within the stream from another device. Prefix it so it's easier
to spot and search for.

See https://bugzilla.redhat.com/show_bug.cgi?id=1364850#c3 for an example of
how such an event can hide.

We only use last_device for comparing pointer values so we don't need a
reference to the device, it doesn't matter if the device itself goes out of
scope.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoconfigure.ac: libinput 1.5rc1 1.4.901
Peter Hutterer [Wed, 7 Sep 2016 03:48:45 +0000 (13:48 +1000)]
configure.ac: libinput 1.5rc1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agoForce the HP Stream 11 touchpad as a clickpad
Peter Hutterer [Thu, 18 Aug 2016 00:48:31 +0000 (10:48 +1000)]
Force the HP Stream 11 touchpad as a clickpad

INPUT_PROP_BUTTONPAD is not set on this device and RMI4 which should fix this
is a bit too far into the future at this point. Hack around it.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
8 years agotablet: add touch arbitration
Peter Hutterer [Tue, 28 Jun 2016 01:28:34 +0000 (11:28 +1000)]
tablet: add touch arbitration

So far we've relied on the wacom kernel module to do touch arbitration for us
but that won't be the case in upcoming kernels. Implement touch arbitration in
userspace by pairing the two devices and suspending the touch device whenever
a tool comes into proximity.

In the future more sophisticated arbitration can be done (e.g. only touches
which are close to the pen) but let's burn that bridge when we have to cross
it.

Note that touch arbitration is "device suspend light", i.e. we leave the
device enabled and the fd is active. Tablet interactions are comparatively
short-lived, so closing the fd and asking logind for a new one every time the
pen changes proximity is suboptimal. Instead, we just keep a boolean around
and discard all events while it is set.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agoevdev: split resetting to a neutral state out
Peter Hutterer [Mon, 5 Sep 2016 05:00:51 +0000 (15:00 +1000)]
evdev: split resetting to a neutral state out

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotest: add litest_assert_touch_sequence helper
Peter Hutterer [Fri, 2 Sep 2016 04:19:45 +0000 (14:19 +1000)]
test: add litest_assert_touch_sequence helper

Touch sequences are interrupted by TOUCH_FRAME events which makes them
annoying to handle event-by-event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotest: move the Intuos 5 and Cintiq 13HD test tablets into the same device group
Peter Hutterer [Wed, 6 Jul 2016 02:54:30 +0000 (12:54 +1000)]
test: move the Intuos 5 and Cintiq 13HD test tablets into the same device group

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agoevdev: release current touches when the device is suspended
Peter Hutterer [Tue, 2 Aug 2016 07:03:54 +0000 (17:03 +1000)]
evdev: release current touches when the device is suspended

Previously suspending a touch device with at least one touch down would never
release the touch point.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agoevdev: don't send frame events if we filtered the touch event
Peter Hutterer [Wed, 3 Aug 2016 02:19:54 +0000 (12:19 +1000)]
evdev: don't send frame events if we filtered the touch event

If the touch is inactive the seat_slot is -1 and we filter the event. The same
happens for devices that send may touch events but aren't touch devices like
any touch-capable mouse. In those cases we sent a bunch of 'empty' touch frame
events. Stop this by checking if we actually flushed the respective event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agoevdev: let the fallback_flush... function decide whether a frame is needed
Peter Hutterer [Wed, 3 Aug 2016 01:58:23 +0000 (11:58 +1000)]
evdev: let the fallback_flush... function decide whether a frame is needed

Rather than testing before if we have an event that matches the need for a
frame simply return the event sent by the flush function. If that event
matches those that need frame events, send the event then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agoevdev: split out mt event flushing
Peter Hutterer [Tue, 2 Aug 2016 06:37:03 +0000 (16:37 +1000)]
evdev: split out mt event flushing

No functional changes, this is prep work for being able to release touch
points on the fly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
8 years agotest: add trackpoint palm detection tests
Peter Hutterer [Tue, 6 Sep 2016 23:09:04 +0000 (09:09 +1000)]
test: add trackpoint palm detection tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
8 years agodoc: extend build instructions for dependencies
Peter Hutterer [Wed, 31 Aug 2016 23:49:24 +0000 (09:49 +1000)]
doc: extend build instructions for dependencies

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