platform/upstream/libinput.git
9 years agoudev: include new udev rule in EXTRA_DIST
Peter Hutterer [Tue, 4 Aug 2015 00:25:47 +0000 (10:25 +1000)]
udev: include new udev rule in EXTRA_DIST

Fixes distcheck

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: always enable the bottom-most area for thumb detection
Peter Hutterer [Tue, 28 Jul 2015 03:25:45 +0000 (13:25 +1000)]
touchpad: always enable the bottom-most area for thumb detection

If the touchpad is higher than 50mm, enable bottom area thumb detection. This
only applies to the bottom-most 8mm and only if the touch remains unmoving in
that area.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agogestures: reduce 2fg scroll timeout to 500ms
Peter Hutterer [Mon, 3 Aug 2015 05:08:57 +0000 (15:08 +1000)]
gestures: reduce 2fg scroll timeout to 500ms

Holding the fingers in place without moving for 500ms is long enough to lock
in a scroll gesture, especially while we're still waiting for the rest of the
stack to expose pinch gestures.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agodoc: add a page about touchpads
Peter Hutterer [Mon, 3 Aug 2015 04:28:43 +0000 (14:28 +1000)]
doc: add a page about touchpads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMerge branch 'disable-gestures-semi-mt'
Peter Hutterer [Mon, 3 Aug 2015 01:40:37 +0000 (11:40 +1000)]
Merge branch 'disable-gestures-semi-mt'

9 years agotouchpad: pretend the jumpy semi-mt touchpad is a single-touch touchpad
Peter Hutterer [Thu, 30 Jul 2015 01:54:38 +0000 (11:54 +1000)]
touchpad: pretend the jumpy semi-mt touchpad is a single-touch touchpad

The first finger is accurate, it's just the second finger that is imprecise,
so we can't handle it as a true touch. Instead, revert the device back to
being a single-touch touchpad and use the fake touch bits for second finger
handling.

Two-finger scrolling thus becomes usable though we will lose out on
other features like thumb detection. Useful scrolling trumps that though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: elantech touchpads can use a 2mm gesture motion threshold
Peter Hutterer [Thu, 30 Jul 2015 01:46:13 +0000 (11:46 +1000)]
touchpad: elantech touchpads can use a 2mm gesture motion threshold

Unlike ALPS and Synaptics semi-mt touchpads, the Elantech touchpads appear to
be precise enough to allow a smaller motion threshold before we decide on the
type of gesture (pinch vs scroll).

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: disable gestures on Synaptics semi-mt touchpads
Peter Hutterer [Thu, 30 Jul 2015 01:07:58 +0000 (11:07 +1000)]
touchpad: disable gestures on Synaptics semi-mt touchpads

Follow-up to eb146677e, if we disable 2fg scrolling on those touchpads we
should also disable gestures. The data doesn't magically become more useful.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: make gestures optional
Peter Hutterer [Thu, 30 Jul 2015 00:48:39 +0000 (10:48 +1000)]
touchpad: make gestures optional

Not all multi-finger touchpads are able to reliably produce gestures, so make
it optional. This patch just adds a boolean (currently always true) that gets
set on touchpad init time, i.e. it is not run-time configurable.

Three and four-finger gestures are filtered out in gesture_notify(), if the
cap isn't set the event is discarded.

For two-finger gestures we prevent a transition to PINCH, so we don't
inadvertently detect a pinch gesture and then not send events. This way, a 2fg
gesture is always scroll.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: fix test case failure caused by belated timer
Peter Hutterer [Fri, 31 Jul 2015 06:50:02 +0000 (16:50 +1000)]
test: fix test case failure caused by belated timer

See 5cec16eede70f6df44b1c39faae614a66594d774

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agofilter: move the pointer acceleration profiles back to units/ms
Peter Hutterer [Fri, 31 Jul 2015 04:52:56 +0000 (14:52 +1000)]
filter: move the pointer acceleration profiles back to units/ms

There is no need here to use µs since we're just handling speeds/thresholds,
not actual events where a ms granularity can be too high.

Moving back to ms lets us drop a bunch of zeroes that clutter up the code, and
since the acceleration functions are a bit magic anyway, having the various
1000.0 factors in there makes it even less obvious.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
9 years agofilter: fix x230 acceleration function for the ms→us change
Peter Hutterer [Fri, 31 Jul 2015 04:49:30 +0000 (14:49 +1000)]
filter: fix x230 acceleration function for the ms→us change

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
9 years agotools: fix the velocity range for printing the ptraccel profile
Peter Hutterer [Fri, 31 Jul 2015 02:41:12 +0000 (12:41 +1000)]
tools: fix the velocity range for printing the ptraccel profile

Now using µs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
9 years agotouchpad: move CAP_GESTURE assignment to the touchpad code
Peter Hutterer [Thu, 30 Jul 2015 00:43:30 +0000 (10:43 +1000)]
touchpad: move CAP_GESTURE assignment to the touchpad code

That's where we set the pointer cap too.
No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: move the helper functions to the litest.h file
Peter Hutterer [Thu, 30 Jul 2015 04:48:12 +0000 (14:48 +1000)]
test: move the helper functions to the litest.h file

To avoid duplication

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agodoc: add a page on how to report bugs
Peter Hutterer [Thu, 30 Jul 2015 01:11:12 +0000 (11:11 +1000)]
doc: add a page on how to report bugs

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop distance threshold to detect pinches
Peter Hutterer [Tue, 28 Jul 2015 02:54:16 +0000 (12:54 +1000)]
touchpad: drop distance threshold to detect pinches

This gives us too many false positives of 2fg scroll being detected as pinch
gesture. Reporter in [1] uses index+ring finger and thus exceeds the distance
easily (that's admittedly a special case).

This is worsed by the lack of a client stack that handles the gestures. User's
don't see that they're inadvertently performing a gesture, they just see 2fg
scroll not working.

Drop the distance for now, once we have a ubiquitous client stack we can
revisit and bring it back.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1246868

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agogestures: check ntouches, not just num_slots for the number of fingers
Peter Hutterer [Wed, 29 Jul 2015 07:12:53 +0000 (17:12 +1000)]
gestures: check ntouches, not just num_slots for the number of fingers

We need to check fake fingers as well as real fingers, especially for
two-finger scrolling on single-touch touchpads with BTN_TOOL_DOUBLETAP.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: abort if we trigger a libinput bug message
Peter Hutterer [Wed, 29 Jul 2015 06:06:20 +0000 (16:06 +1000)]
test: abort if we trigger a libinput bug message

Only abort on client or libinput bugs, skip over kernel bugs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
9 years agotest: add missing libinput_dispatch() before timeouts
Peter Hutterer [Wed, 29 Jul 2015 06:29:46 +0000 (16:29 +1000)]
test: add missing libinput_dispatch() before timeouts

see 5cec16eede70.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
9 years agotouchpad: update the thumb move timeout to µs
Peter Hutterer [Wed, 29 Jul 2015 01:00:17 +0000 (11:00 +1000)]
touchpad: update the thumb move timeout to µs

And add a #define for it so we stop hiding it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
9 years agotest: add a bunch of libinput_dispatch() before timeout calls
Peter Hutterer [Tue, 28 Jul 2015 23:52:28 +0000 (09:52 +1000)]
test: add a bunch of libinput_dispatch() before timeout calls

98346f6a1aa added a warning about timeouts expiring before now. Those warnings
are triggered by a bunch of tests where we have events, then a timeout, then a
libinput_dispatch().

All these are bugs in the test, since we can't guarantee the order of fds (and
thus which fd the events are pulled off first) it's just lucky that they worked.
Insert the required libinput_dispatch() calls.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
9 years agotouchpad: log when thumb detection is enabled on a device
Peter Hutterer [Tue, 28 Jul 2015 03:09:52 +0000 (13:09 +1000)]
touchpad: log when thumb detection is enabled on a device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoIgnore test devices for libinput contexts not run from the test suite
Jonas Ådahl [Mon, 27 Jul 2015 08:08:04 +0000 (16:08 +0800)]
Ignore test devices for libinput contexts not run from the test suite

Add a LIBINPUT_TEST_DEVICE udev parameter to test devices created by
the test suite. When an application tries to add such a device to the
path backend or when the udev backend discovers such a device, it will
be ignored. Only the context when run via the test suite will actually
handle these devices.

Doing this will enable a user to run the libinput test suite on a system
running libinput without having the test suite devices interfering with
the actual system.

Note that X.org users running an input device driver that is not the
libinput X input driver will still need to manually configure the X
server to ignore such devices (see test/50-litest.conf).

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: Make udev path variables more explicitly named
Jonas Ådahl [Mon, 27 Jul 2015 07:53:53 +0000 (15:53 +0800)]
test: Make udev path variables more explicitly named

This is to make room for more types of rules files.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoChange to micro seconds for measuring time internally
Jonas Ådahl [Mon, 27 Jul 2015 09:51:52 +0000 (17:51 +0800)]
Change to micro seconds for measuring time internally

In order to provide higher precision event time stamps, change the
internal time measuring from milliseconds to microseconds.
Microseconds are chosen because it is the most fine grained time stamp
we can get from evdev.

The API is extended with high precision getters whenever the given
information is available.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotimer: Warn about negative timer offsets
Jonas Ådahl [Mon, 27 Jul 2015 09:26:20 +0000 (17:26 +0800)]
timer: Warn about negative timer offsets

Even if it may be caused by extreme stalls, warn if the timer was set to
be triggered even before 'now' when it actually is triggered, as it is
more likely a programming error.

Part of the reason for this commit was not to convert the unsigned int
to a signed int (which abs() does).

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest/pointer: Don't rely on velocities in direction change test
Jonas Ådahl [Mon, 27 Jul 2015 03:54:18 +0000 (11:54 +0800)]
test/pointer: Don't rely on velocities in direction change test

We currently rely on an extra millisecond being added by the filter
code to get a velocity that are small enough to not hit the max
acceleration limit. If this arbitrary millisecond is changed (for
example by changing the internal time measurment to microseconds and
adding just a microsecond instead), the velocity may change so that the
maximum or minimum acceleration is always hit.

Adding a delay to the test won't work either since it would not only rely
on ending up within the acceleration limits but there would also be an
non-deterministic actual delay causing the velocity of the movement
after the direction change to be potentially larger than the movement
in the original direction due to the actual time delta in libinput will
not always be 1ms.

To fix the test to not rely on any artificial delays in the filter code
nor any non-deterministic delays in the test, lets just test that the
direction change of the hardware events resulted in a direction change
of the libinput motion events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoAlways use uint64_t for internal timestamp values
Jonas Ådahl [Mon, 27 Jul 2015 03:52:44 +0000 (11:52 +0800)]
Always use uint64_t for internal timestamp values

In most places we use 64 bit unsigned integers; lets be consistent and
use it everywhere.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: Use ck_assert_double_ for checking doubles in some places
Jonas Ådahl [Thu, 23 Jul 2015 07:23:30 +0000 (15:23 +0800)]
test: Use ck_assert_double_ for checking doubles in some places

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: disable 2fg scrolling on Synaptics semi-mt touchpads
Peter Hutterer [Tue, 14 Jul 2015 00:27:46 +0000 (10:27 +1000)]
touchpad: disable 2fg scrolling on Synaptics semi-mt touchpads

These touchpads have a terrible resolution when two fingers are down, causing
scrolling to jump around a lot. That then turns into bug reports that we can't
do much about, the data is simply garbage.

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>
9 years agotouchpad: don't check clickfinger distance for three fingers
Peter Hutterer [Thu, 23 Jul 2015 06:06:48 +0000 (16:06 +1000)]
touchpad: don't check clickfinger distance for three fingers

It's reasonable to expect a thumb (or the other hand's index finger) to click
a button while a finger is down for movement. It's less reasonable to expect
this when two fingers are interacting with the touchpad, or when two fingers
click the touchpad (even on a large touchpad that's an awkward position).

Simplify the clickfinger detection mechanism - if we have three touches down,
it's always a three-finger click. Two fingers may be a right click or a index
+ thumb click.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: don't leak the custom udev rule path for devices with custom creates
Peter Hutterer [Mon, 27 Jul 2015 00:54:36 +0000 (10:54 +1000)]
test: don't leak the custom udev rule path for devices with custom creates

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: rename 2fg natural scroll test to be more obvious
Peter Hutterer [Mon, 27 Jul 2015 00:25:55 +0000 (10:25 +1000)]
test: rename 2fg natural scroll test to be more obvious

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: enable 2fg scrolling before tests that rely on it
Peter Hutterer [Mon, 27 Jul 2015 00:32:28 +0000 (10:32 +1000)]
test: enable 2fg scrolling before tests that rely on it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: filter out edge-scroll-only touchpads from 2fg scroll tests
Peter Hutterer [Mon, 27 Jul 2015 00:24:32 +0000 (10:24 +1000)]
test: filter out edge-scroll-only touchpads from 2fg scroll tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: don't log a bug for Apple's one-button touchpads
Peter Hutterer [Sun, 26 Jul 2015 23:19:21 +0000 (09:19 +1000)]
touchpad: don't log a bug for Apple's one-button touchpads

Apple used to have a single-button touchpad that was not a clickpad. Skip
logging an error for that one.

Found in https://bugzilla.redhat.com/show_bug.cgi?id=1246651.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMerge branch 'thumb-detect-improvements'
Peter Hutterer [Thu, 23 Jul 2015 23:19:08 +0000 (09:19 +1000)]
Merge branch 'thumb-detect-improvements'

9 years agotouchpad: put a movement threshold on thumb detection
Peter Hutterer [Wed, 22 Jul 2015 01:53:22 +0000 (11:53 +1000)]
touchpad: put a movement threshold on thumb detection

If a thumb moves around, it's not resting and we should consider it a normal
touch.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: a pressure change alone needs touch processing, mark as dirty
Peter Hutterer [Wed, 22 Jul 2015 02:24:47 +0000 (12:24 +1000)]
touchpad: a pressure change alone needs touch processing, mark as dirty

A thumb may not move, but may change pressure so we need to process
accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: fix default axis value assignment
Peter Hutterer [Wed, 22 Jul 2015 02:22:33 +0000 (12:22 +1000)]
test: fix default axis value assignment

Was assigned to -1 if no custom axes were provided.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: only run 3-slot test for touchpads with three slots
Peter Hutterer [Tue, 21 Jul 2015 23:21:13 +0000 (09:21 +1000)]
test: only run 3-slot test for touchpads with three slots

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: only try thumb detection in the lowest 15/8mm
Peter Hutterer [Fri, 17 Jul 2015 01:17:22 +0000 (11:17 +1000)]
touchpad: only try thumb detection in the lowest 15/8mm

That's the most likely area it will be resting in, if it's sitting anywhere
above that it's likely part of an interaction.

A thumb in the lowest 15mm needs to trigger the pressure threshold before it's
labelled a thumb. A thumb in the lowest 8mm is considered a thumb if it
remains there for 300ms. Regardless of the pressure, since we can't reliably
get pressure here. If a thumb moves out of the area, or starts outside of that
area it is never a thumb.

If edge scrolling is enabled, the 8mm threshold is ineffective since we'll
have normal interaction in that zone for horizontal scrolling.

The thumb tests now require all touchpads to be switched to clickfinger, if we
test for thumb detection on the bottom of the pad we won't get expected
motion events due to the software button area.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: hook up disable-while-typing configuration
Peter Hutterer [Wed, 8 Jul 2015 22:14:35 +0000 (08:14 +1000)]
touchpad: hook up disable-while-typing configuration

This is not a frequent toggle, so we don't need to jump through too many hoops
here. We simply enable/disable on command and once any current timeouts have
expired the new setting takes effect.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoAdd a configuration interface for enabling/disabling disable-while-typing
Peter Hutterer [Wed, 8 Jul 2015 05:03:06 +0000 (15:03 +1000)]
Add a configuration interface for enabling/disabling disable-while-typing

DWT can interfere with some applications where keyboard and touchpad use at
the same time is common, e.g. games but also anything that requires a
combination of frequent pointer motion and use of keyboard shortcuts.

Expose a toggle to disable DWT where needed.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: drop TOUCHPAD_HAS_TRACKPOINT_BUTTONS parsing
Peter Hutterer [Thu, 23 Jul 2015 04:27:59 +0000 (14:27 +1000)]
touchpad: drop TOUCHPAD_HAS_TRACKPOINT_BUTTONS parsing

This was a stopgap measure to support the Lenovo Carbon X1 3rd and the Lenovo
*50 series. These devices have the trackpoint buttons wired to the touchpad
and thus trackpoint events came from the touchpad device.

This was fixed in the kernel commit cdd9dc195916ef5644cfac079094c3c1d1616e4c,
the systemd hwdb to set this property was removed in 05304592457e01 so nothing
sets this property anymore. Drop it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: split button tests into separate binary
Peter Hutterer [Thu, 23 Jul 2015 01:29:32 +0000 (11:29 +1000)]
test: split button tests into separate binary

We're again hitting the fork ulimits again (see also 9c2afae14) causing test
case failures in the valgrind run of the touchpad test.
Split out the touchpad button tests so we don't require special ulimits on
test boxes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: only initialize the generic rules/hwdb once
Peter Hutterer [Wed, 22 Jul 2015 00:44:44 +0000 (10:44 +1000)]
test: only initialize the generic rules/hwdb once

Installing the udev rules and reloading udevadm takes around 150ms each
time. For test-pointer alone (currently 336 tests) this adds almost a
minute to the runtime.
The model quirks and libinput udev rules don't change, so installing them once
at the start of the test run is sufficient.

Unfortunately, now that we're not as slow anymore to initialize, we need to
up the maximum wait time for the path device to wait for a udev device to
initialize.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoMerge branch 'edge-scroll-on-edge-only'
Peter Hutterer [Thu, 23 Jul 2015 04:50:03 +0000 (14:50 +1000)]
Merge branch 'edge-scroll-on-edge-only'

9 years agoMerge branch 'serial-synaptics-cursor-jump'
Peter Hutterer [Thu, 23 Jul 2015 00:34:03 +0000 (10:34 +1000)]
Merge branch 'serial-synaptics-cursor-jump'

9 years agoMerge branch 'reduce-motion-thresholds'
Peter Hutterer [Thu, 23 Jul 2015 00:28:49 +0000 (10:28 +1000)]
Merge branch 'reduce-motion-thresholds'

9 years agotouchpad: only edge-scroll while the finger is in the edge area
Peter Hutterer [Mon, 13 Jul 2015 04:14:42 +0000 (14:14 +1000)]
touchpad: only edge-scroll while the finger is in the edge area

When the touch leaves the area for edge scrolling after starting to scroll,
discard any movement. This signals to the user that they've left the area and
forces them to lift the finger to switch back to motion. If the finger moves
back into the area, scrolling continues.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: make the edge-scroll edge 7mm wide
Peter Hutterer [Mon, 13 Jul 2015 02:56:39 +0000 (12:56 +1000)]
touchpad: make the edge-scroll edge 7mm wide

Rather than magic percentages of the touchpad axis ranges, make it a fixed
size of 7mm.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: enable 2fg scrolling on most palm tests
Peter Hutterer [Tue, 14 Jul 2015 01:30:50 +0000 (11:30 +1000)]
test: enable 2fg scrolling on most palm tests

edge scrolling disables some palm detection, so we can't run those tests when
active. That fell through the cracks so far, all devices with edge scroll by
default were too small to enable palm detection.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: fix hover test to avoid the edge scroll zone
Peter Hutterer [Tue, 14 Jul 2015 02:06:03 +0000 (12:06 +1000)]
test: fix hover test to avoid the edge scroll zone

On the synaptics hover device where this test is run, we'd eventually get into
the edge scroll zone. When edge scrolling is enabled this causes the test to
fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: reset the motion history during/after a slots->nfake crossover
Peter Hutterer [Mon, 20 Jul 2015 03:10:29 +0000 (13:10 +1000)]
touchpad: reset the motion history during/after a slots->nfake crossover

Whenever we cross from N slots to at least one fake finger, reset the motion
history and skip the next event too. Especially on serial Synaptics touchpads,
the first touch update after a two-slot → TRIPLETAP is garbage, as is the one
from TRIPLETAP → two slots.

Example sequence reproduce on a T440s:

E: 4.488757 0003 003a 0084      # EV_ABS / ABS_MT_PRESSURE      84
E: 4.488757 0003 002f 0001      # EV_ABS / ABS_MT_SLOT          1
E: 4.488757 0003 0039 0433      # EV_ABS / ABS_MT_TRACKING_ID   433
E: 4.488757 0003 0035 2500      # EV_ABS / ABS_MT_POSITION_X    2500
E: 4.488757 0003 0036 3064      # EV_ABS / ABS_MT_POSITION_Y    3064
E: 4.488757 0003 003a 0060      # EV_ABS / ABS_MT_PRESSURE      60
E: 4.488757 0003 0018 0084      # EV_ABS / ABS_PRESSURE         84
E: 4.488757 0001 0145 0000      # EV_KEY / BTN_TOOL_FINGER      0
E: 4.488757 0001 014e 0001      # EV_KEY / BTN_TOOL_TRIPLETAP   1
E: 4.488757 0000 0000 0000      # ------------ SYN_REPORT (0) ----------
E: 4.508506 0003 002f 0000      # EV_ABS / ABS_MT_SLOT          0
E: 4.508506 0003 0036 2982      # EV_ABS / ABS_MT_POSITION_Y    2982
E: 4.508506 0003 003a 0086      # EV_ABS / ABS_MT_PRESSURE      86
E: 4.508506 0003 002f 0001      # EV_ABS / ABS_MT_SLOT          1
E: 4.508506 0003 0035 3464      # EV_ABS / ABS_MT_POSITION_X    3464
E: 4.508506 0003 0036 2716      # EV_ABS / ABS_MT_POSITION_Y    2716
E: 4.508506 0003 0001 2982      # EV_ABS / ABS_Y                2982
E: 4.508506 0003 0018 0086      # EV_ABS / ABS_PRESSURE         86
E: 4.508506 0000 0000 0000      # ------------ SYN_REPORT (0) ----------

subsequent events then hover around the 3464 mark, but that initial jump is
enough to cause a massive cursor jump.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: handle serial synaptics slot confusion on TRIPLETAP
Peter Hutterer [Thu, 16 Jul 2015 23:30:03 +0000 (09:30 +1000)]
touchpad: handle serial synaptics slot confusion on TRIPLETAP

Synatics touchpads only have 2 slots, but support TRIPLETAP and above. When
the third finger touches, the kernel may end the second slot and re-start it
with the coordinates of the third touch in the next frame. The event sequence
is something like:

ABS_MT_SLOT          0
ABS_MT_POSITION_X    4000
ABS_MT_POSITION_Y    4000
ABS_MT_PRESSURE      78
ABS_MT_SLOT          1
ABS_MT_TRACKING_ID   -1

ABS_X                4000
ABS_Y                4000
ABS_PRESSURE         78
BTN_TOOL_DOUBLETAP   0
BTN_TOOL_TRIPLETAP   1
--- SYN_REPORT (0) ----------
ABS_MT_SLOT          0
ABS_MT_POSITION_X    4000
ABS_MT_POSITION_Y    4000
ABS_MT_PRESSURE      78
ABS_MT_SLOT          1
ABS_MT_TRACKING_ID   55
ABS_MT_POSITION_X    2000
ABS_MT_POSITION_Y    2000
ABS_MT_PRESSURE      72

ABS_X                4000
ABS_Y                4000
ABS_PRESSURE         78
--- SYN_REPORT (0) ----------

libinput usually ignores any BTN_TOOL_* <= num_slots since we expect
that the slot values are valid. Make an exception for the serial synaptics
touchpads. If a touch has ended when the fake touch goes above active-slots
(but still within num-slots), move that touch back to UPDATE. This ensures the
right number of nfingers_down. When the touch restarts again in the next
frame, tp_begin_touch() will skip over re-initializing it because it's already
in UPDATE anyway.

Note that at this point this only handles the transition _to_ TRIPLETAP, not
from TRIPLETAP to DOUBLETAP. Need to wait for this to be seen in the wild
first.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoTag synaptics serial touchpads with a LIBINPUT_MODEL tag
Peter Hutterer [Thu, 16 Jul 2015 06:05:48 +0000 (16:05 +1000)]
Tag synaptics serial touchpads with a LIBINPUT_MODEL tag

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: allow for multiple LIBINPUT_MODEL_* flags per device
Peter Hutterer [Thu, 16 Jul 2015 05:59:01 +0000 (15:59 +1000)]
evdev: allow for multiple LIBINPUT_MODEL_* flags per device

On some devices we need to set more than one flag, i.e. make it into actual
flags.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hallelujah-expressed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotest: only run 3-slot test for touchpads with three slots
Peter Hutterer [Tue, 21 Jul 2015 23:21:13 +0000 (09:21 +1000)]
test: only run 3-slot test for touchpads with three slots

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMove CASE_RETURN_STRING to libinput-util.h
Peter Hutterer [Mon, 20 Jul 2015 04:37:37 +0000 (14:37 +1000)]
Move CASE_RETURN_STRING to libinput-util.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: scale thumb pressure threshold with the resolution
Peter Hutterer [Mon, 20 Jul 2015 00:27:29 +0000 (10:27 +1000)]
touchpad: scale thumb pressure threshold with the resolution

On touchpads with a higher resolution we also see higher pressure values.
Scale accordingly, but use the T440s as reference and don't go below that
device's threshold. A false positive is worse than a false negative when it
comes to thumb detection.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: use the top-most touch for fake finger positions
Peter Hutterer [Fri, 17 Jul 2015 06:40:50 +0000 (16:40 +1000)]
touchpad: use the top-most touch for fake finger positions

The average human hand has four fingers but only one thumb, i.e. the chance of
a fake finger being close to the top-most touch is higher than to whatever the
first touch was (which may be a thumb at the bottom of the touchpad).
So search for the top-most real touch and copy its position into the fake
touches.

This also fixes another bug with the previous code - the first slot may not be
active but we still used its position for the fake touches. Whether that was
really triggerable is questionable though.

The test is only run for the T440 touchpad - we know it's big enough to
enable thumb detection and that way we don't have to double-check in the how
big the touchpad is, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: ignore thumbs when counting clickfingers
Peter Hutterer [Fri, 17 Jul 2015 06:38:16 +0000 (16:38 +1000)]
touchpad: ignore thumbs when counting clickfingers

We may have four fingers on the touchpad - three real ones + a thumb. Count it
as three-finger click then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: 4-finger clickfingers are middle button clicks
Peter Hutterer [Tue, 21 Jul 2015 22:48:03 +0000 (08:48 +1000)]
touchpad: 4-finger clickfingers are middle button clicks

If a thumb is resting with a three-finger click, that must be a middle-click.
And the odd case where we have a real four-finger click doesn't need worrying
about.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: only enable thumb detection on clickpads
Peter Hutterer [Mon, 20 Jul 2015 06:01:32 +0000 (16:01 +1000)]
touchpad: only enable thumb detection on clickpads

The use-case we have thumb detection for is to let a user rest a thumb on the
touchpad before clicking. On a touchpad with physical buttons, the thumb won't
be resting on the touchpad.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: skip thumb detection for touchpads smaller than 50mm
Peter Hutterer [Fri, 17 Jul 2015 01:29:40 +0000 (11:29 +1000)]
touchpad: skip thumb detection for touchpads smaller than 50mm

Gets a bit cramped if you're trying to rest the thumb on a touchpad that
small.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoMove CASE_RETURN_STRING to libinput-util.h
Peter Hutterer [Mon, 20 Jul 2015 04:37:37 +0000 (14:37 +1000)]
Move CASE_RETURN_STRING to libinput-util.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: reduce unpin threshold to 1.5mm
Peter Hutterer [Mon, 20 Jul 2015 01:24:17 +0000 (11:24 +1000)]
touchpad: reduce unpin threshold to 1.5mm

3mm is too large, it makes the touchpad feel sluggish. We already take fuzz
into account through the hysteresis and the real issue we have with the
pointer moving on a click is _before_ the BTN_LEFT event comes in, not after.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: reduce 2fg scroll threshold to 2mm
Peter Hutterer [Mon, 20 Jul 2015 01:13:55 +0000 (11:13 +1000)]
touchpad: reduce 2fg scroll threshold to 2mm

3mm is too large, especially on fine-grained scroll motions. Since we
already use the hysteresis to defuzz the current touchpad point, having a
slower threshold here should not cause any adverse motions.

This affects the pinch gestures too and needs a minor test adjustment. The
atmel hover device's resolution is low enough that we trigger a >1 degree
angle now, make the movement a bit more finegrained.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotools: handle the initial set of events at event-gui's startup
Peter Hutterer [Tue, 21 Jul 2015 01:53:57 +0000 (11:53 +1000)]
tools: handle the initial set of events at event-gui's startup

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: restore pointing stick const accel property parsing
Peter Hutterer [Mon, 20 Jul 2015 23:33:47 +0000 (09:33 +1000)]
evdev: restore pointing stick const accel property parsing

Regression introduced in 8302860.

Reading the DPI before evdev_configure_device makes it lose on the trackpoint
flag, causing libinput to ignore the POINTINGSTICK_CONST_ACCEL property.

8302860 moved it up so we can init accel based on the DPI, this patch simply
moves istart t before the acceleration is initialized.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoMark internal log functions with attribute(printf)
Peter Hutterer [Tue, 21 Jul 2015 01:01:39 +0000 (11:01 +1000)]
Mark internal log functions with attribute(printf)

And fix all the places where we passed in garbage.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: log a trackpoint const accel setting
Peter Hutterer [Mon, 20 Jul 2015 21:31:36 +0000 (07:31 +1000)]
evdev: log a trackpoint const accel setting

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoCode cleanup
Thomas Hindoe Paaboel Andersen [Mon, 20 Jul 2015 01:27:09 +0000 (03:27 +0200)]
Code cleanup

Removes some dead assignments, an unused function, and
uses %d format specifier for int.

Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoDrop vector_length(), replace with hypot(3)
Peter Hutterer [Mon, 20 Jul 2015 01:09:19 +0000 (11:09 +1000)]
Drop vector_length(), replace with hypot(3)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop two now unused defines
Peter Hutterer [Mon, 20 Jul 2015 01:02:47 +0000 (11:02 +1000)]
touchpad: drop two now unused defines

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotools: only print angle/scale for pinch events
Peter Hutterer [Mon, 20 Jul 2015 00:59:45 +0000 (10:59 +1000)]
tools: only print angle/scale for pinch events

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: fix typo
Peter Hutterer [Fri, 17 Jul 2015 01:02:34 +0000 (11:02 +1000)]
touchpad: fix typo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: add 3fg and 4fg clickfinger tests
Peter Hutterer [Fri, 17 Jul 2015 00:55:34 +0000 (10:55 +1000)]
test: add 3fg and 4fg clickfinger tests

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: remove a leftover check for fake resolution
Peter Hutterer [Thu, 16 Jul 2015 05:54:47 +0000 (15:54 +1000)]
touchpad: remove a leftover check for fake resolution

obsolete since 8658ff159d416b6a567acb2aaf72b27887ad8576. And once we remove
that all we checkf or is Apple models which we set a resolution for in
systemd. So that check is obsolete now too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoudev: don't install the litest udev rules
Peter Hutterer [Thu, 16 Jul 2015 05:15:20 +0000 (15:15 +1000)]
udev: don't install the litest udev rules

They are installed by the test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoconfigure.ac: libinput 0.20.0 0.20.0
Peter Hutterer [Thu, 16 Jul 2015 04:15:11 +0000 (14:15 +1000)]
configure.ac: libinput 0.20.0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: fix path to custom litest rules
Peter Hutterer [Thu, 16 Jul 2015 02:24:29 +0000 (12:24 +1000)]
test: fix path to custom litest rules

Fixes distcheck

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: use bootstrap for doxygen styling
Peter Hutterer [Thu, 16 Jul 2015 01:22:36 +0000 (11:22 +1000)]
doc: use bootstrap for doxygen styling

Makes the documentation less of an eyesore.

Header/footer from:
https://github.com/Velron/doxygen-bootstrapped, Apache-licensed

Bootstrap style from:
https://bootswatch.com/paper/, MIT licensed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: strip doxygen file from all default values
Peter Hutterer [Thu, 16 Jul 2015 01:10:22 +0000 (11:10 +1000)]
doc: strip doxygen file from all default values

Only keep those that we changed locally, which makes it much easier to detect
what we're actually changing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: add a page about the available tools
Peter Hutterer [Thu, 16 Jul 2015 00:56:55 +0000 (10:56 +1000)]
doc: add a page about the available tools

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: group the "related pages" by general topic
Peter Hutterer [Thu, 16 Jul 2015 00:31:34 +0000 (10:31 +1000)]
doc: group the "related pages" by general topic

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop thumb handling from gestures
Peter Hutterer [Wed, 15 Jul 2015 00:04:46 +0000 (10:04 +1000)]
touchpad: drop thumb handling from gestures

Thumb detection interfered with gestures a fair bit but it shouldn't. A pinch
gesture with a thumb is a fairly natural move so we shouldn't cancel that.
A swipe gesture with a thumb on the touchpad - well, don't do that. No need
for code here.

Reported-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
9 years agotest: add a couple of basic gesture tests
Peter Hutterer [Tue, 7 Jul 2015 01:52:05 +0000 (11:52 +1000)]
test: add a couple of basic gesture tests

3finger swipe, pinch and spread. While we expect the pinch/spread to have a
zero angle, the discrete coordinates we use cause some angle, but below 1
degree.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoevdev: parse LIBINPUT_ATTR_RESOLUTION_HINT
Peter Hutterer [Fri, 10 Jul 2015 03:59:06 +0000 (13:59 +1000)]
evdev: parse LIBINPUT_ATTR_RESOLUTION_HINT

For Elantech touchpads, we know that the resolution is 31u/mm (800dpi) for
v1-v3 firmware. Set this as a hint until we get either the kernel or systemd
to set this for us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: fix typo in comment
Peter Hutterer [Tue, 14 Jul 2015 21:33:12 +0000 (07:33 +1000)]
touchpad: fix typo in comment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotest: check for fcntl() return value
Peter Hutterer [Tue, 14 Jul 2015 04:19:25 +0000 (14:19 +1000)]
test: check for fcntl() return value

Mostly to silence coverity complaints.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotouchpad: drop fake resolution handling
Peter Hutterer [Tue, 30 Jun 2015 10:56:03 +0000 (20:56 +1000)]
touchpad: drop fake resolution handling

Now that we have all devices init a fixed resolution we don't need code to
handle custom cases anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agotouchpad: default to a 69x50mm sized touchpad
Peter Hutterer [Tue, 30 Jun 2015 04:26:11 +0000 (14:26 +1000)]
touchpad: default to a 69x50mm sized touchpad

The previous approach of using the axis ranges and approximating parameters
based on the x/y axis range clutters up the code and is generally unreliable.
If we look at Synaptics touchpads, the resolution ranges from 42 to 130 while
the axes stay the same axis range. Other touchpads likely have a similar
variation across the various models.

Let's make this simpler in code: unless we know otherwise, simply assume a
default-sized touchpad.
Anything that deviates from that can be fixed with the new hwdb entries to
provide a more correct setting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoudev: add size hint for apple touchpads
Peter Hutterer [Tue, 30 Jun 2015 03:03:56 +0000 (13:03 +1000)]
udev: add size hint for apple touchpads

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoudev: add ALPS firmware detection and size properties
Peter Hutterer [Tue, 30 Jun 2015 03:00:10 +0000 (13:00 +1000)]
udev: add ALPS firmware detection and size properties

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoudev: add a model-quirks callout
Peter Hutterer [Thu, 9 Jul 2015 03:47:52 +0000 (13:47 +1000)]
udev: add a model-quirks callout

Some model-specific information isn't available through udev properties. This
callout is used to query the device directly and set a property that we can
then match on for the hwdb entries.

This is geared for Elantech and ALPS touchpads where the firmware version is
the interesting bit. The udev rule is added already to match on that, note
that the callout doesn't do anything at this point. The various
touchpad-related things will be added separately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoevdev: use LIBINPUT_ATTR_SIZE_HINT for resolutions
Peter Hutterer [Tue, 30 Jun 2015 02:15:12 +0000 (12:15 +1000)]
evdev: use LIBINPUT_ATTR_SIZE_HINT for resolutions

Touchpads, notably Elantech, ALPS and bcm5974 don't provide x/y resolution
until recent generations.
Add a new property, LIBINPUT_ATTR_SIZE_HINT, that provides size information to
libinput. Note that this property *does not* override true resolution values,
it is only used when the resolution is missing. It is used merely as an
approximate size hint.

If the resolution for a specific device is known it should be added to the
udev hwdb so it can be set globally. See the bcm5974 entries here:
http://cgit.freedesktop.org/systemd/systemd/tree/hwdb/60-evdev.hwdb.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
9 years agoutil: add a helper function to parse a "WIDTHxHEIGHT" property
Peter Hutterer [Tue, 30 Jun 2015 02:00:53 +0000 (12:00 +1000)]
util: add a helper function to parse a "WIDTHxHEIGHT" property

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