Peter Hutterer [Fri, 5 Jun 2015 00:13:56 +0000 (10:13 +1000)]
Move apple touchpad tagging to the udev rules
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 5 Jun 2015 00:52:04 +0000 (10:52 +1000)]
test: always install our own udev rule/hwdb files for tests
We can't rely on the system having these files installed, at least not in the
latest version that we'd like.
Copy them over from the source directory into the /run/ and /etc/ directories
for each test and update udev and the hwdb. This ensures the tags we set in
the hwdb file are always set, regardless of the system configuration.
Note that the /run/udev/* files need to have a different filename to the ones
we ship to avoid getting overridden by local configuration.
systemd does not have support for /run/udev/hwdb.d [1]. So our hwdb.d file
is in /etc/udev/hwdb.d instead and marked them with a REMOVEME and a comment
that if that file is left after the tests, it should be removed by the user.
[1] https://github.com/systemd/systemd/issues/127
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
JoonCheol Park [Thu, 11 Jun 2015 07:38:02 +0000 (16:38 +0900)]
test: add missing libunwind cflags to test-litest-selftest
Signed-off-by: JoonCheol Park <jooncheol@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 8 Jun 2015 22:06:20 +0000 (08:06 +1000)]
filter: require minimum acceleration factor of 0.3
For really slow motions, the previous acceleration factor would go down to
effectively zero. So the slower the mouse motion was, the more it would be
slowed down which made the mouse at low speeds almost unusable.
Cap the minimum acceleration at 0.3 which provides a predictable slow motion
for the cursor when high precision is required.
New/old acceleration functions comparison:
^
| /
| /
ty| _________/
| / /
| / /
| / /
|/ / <----- new minimum accel factor
| /
|/___________________>
tx
i.e. the general shape is maintained, but it doesn't go to zero anymore. The
functions aren't parallel, the new shape is slightly flatter than the previous
one and they meet at the point where the functions flatten for the threshold
(tx/ty). ascii art has its limits...
https://bugzilla.redhat.com/show_bug.cgi?id=1227039
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 9 Jun 2015 23:54:06 +0000 (09:54 +1000)]
touchpad: restart the motion filter on touch begin
Our motion filter takes the last couple of vectors to calculate speed,
provided the direction stays the same and it is within a certain timeout. It
does not take into account lifting the finger, so the velocity on the first
event is off.
Real-world impact is mainly on scrolling. Before commit
289e4675
filter: enforce minimum velocity
the first motion on a scroll was accelerated by a factor of 0 and swallowed.
After
289e4675 the motion was calculated based on the timeout and a fraction
of the expected effect. Now the first scroll motion is based on the real
finger motion since setting the finger down and thus feels a bit more
responsive.
It also makes a couple of test cases using litest_assert_scroll() work again
since the miniumum motion is now as expected.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 9 Jun 2015 21:56:57 +0000 (07:56 +1000)]
doc: make horizontal scrolling a separate section
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Jun 2015 21:52:52 +0000 (07:52 +1000)]
doc: provide an outline of which scroll method is available where
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 9 Jun 2015 21:45:39 +0000 (07:45 +1000)]
doc: add a note that middle-button dragging is not possible on sticks
Just to have something to point bug reporters to.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 5 Jun 2015 01:40:26 +0000 (11:40 +1000)]
test: fix litest_log() when libunwind is missing
Previous expansion had side-effects when litest_log was called in an if
condition without {}
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 5 Jun 2015 00:39:30 +0000 (10:39 +1000)]
test: replace a strncmp call with strneq
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 5 Jun 2015 00:10:56 +0000 (10:10 +1000)]
touchpad: fix whitespace issue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jun 2015 00:20:25 +0000 (10:20 +1000)]
configure.ac: libinput 0.17.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Jun 2015 04:27:43 +0000 (14:27 +1000)]
touchpad: on non-resolution touchpads, use 30% as maximum clickfinger spread
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 3 Jun 2015 02:15:51 +0000 (12:15 +1000)]
touchpad: impose maximum distance limits on clickfingers
A common use-case for clickfinger is to use the index finger for moving the
pointer, then triggering the click with a thumb. If the index finger isn't
lifted before the click this counted as two-finger click.
To avoid this, check the distance between touches on the touchpad (on
touchpads reporting resolution values anyway). If the touches are too far
apart, don't count them together (or specifically only count those close
enough together as multi-finger).
The touch area is uneven, it's wider than high. Spreading fingers horizontally
is more common and this also makes it easier to rule out thumbs which tend to
be well below the fingers.
http://bugs.freedesktop.org/show_bug.cgi?id=90526
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 3 Jun 2015 01:06:54 +0000 (11:06 +1000)]
touchpad: move clickfinger finger decision 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>
Peter Hutterer [Wed, 3 Jun 2015 01:30:11 +0000 (11:30 +1000)]
touchpad: replace hardcoded resolution > 1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Benjamin Tissoires [Tue, 2 Jun 2015 21:22:42 +0000 (17:22 -0400)]
evdev: remove direct checks for INPUT_PROP_POINTING_STICK
If we need to temporary override a device with ID_INPUT_POINTINGSTICK,
evdev sets the tag EVDEV_TAG_TRACKPOINT to the device. Rely on the tag
to behave properly for scroll emulation.
The dpi information should be retrieved after the device has been
configured or the tag EVDEV_TAG_TRACKPOINT was not set.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Benjamin Tissoires [Tue, 2 Jun 2015 21:22:41 +0000 (17:22 -0400)]
evdev: remove tag_device from evdev_dispatch_interface
Tagging a device should occur only once during configure. We do not
have devices that can be changed after they are configured, so there is no
point in having the tagging part in a deferred struct.
Plus, the note saying that we tag with only one of EVDEV_TAG was wrong.
Now that we are chosing when we call each evdev_tag_*, we can also get
rid of the device->seat_caps tests.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Jun 2015 06:32:41 +0000 (16:32 +1000)]
evdev: always default to the middle button for button-scrolling
The current code only defaulted to the middle button for those devices that
used button scrolling by default, requiring the user to enable button
scrolling _and_ set the button before it is active. This causes some
confusion.
There is no real benefit to leaving the button at 0 when the scroll
method isn't enabled anyway. So always default to the middle button (if
available).
https://bugzilla.redhat.com/show_bug.cgi?id=1227182
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 2 Jun 2015 05:45:37 +0000 (15:45 +1000)]
doc: add a graphic to explain tap-n-drag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Jun 2015 03:04:44 +0000 (13:04 +1000)]
touchpad: reduce tap-n-drag timeout to 300ms
The current 500ms is too long, reduce it to 300ms instead. This is still long
enough to get multiple movements but not that long that it feels like the
button is stuck.
https://bugs.freedesktop.org/show_bug.cgi?id=90613
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Tue, 2 Jun 2015 01:04:59 +0000 (18:04 -0700)]
test: check getcwd() and system() return values in litest
Added code to check for errors in getcwd() and system() that
were previously ignored and silently dropped.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jun 2015 23:53:00 +0000 (09:53 +1000)]
Add a CODING_STYLE document
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 22 Apr 2015 02:25:13 +0000 (12:25 +1000)]
filter: enforce minimum velocity
In the current code, a timeout or direction change on the first tracker will
result in a velocity of 0. Really slow movements will thus always be zero, and
the first event after a direction is swallowed.
Enforce a minimum velocity:
In the case of a timeout, assume the current velocity is that of
distance/timeout. In the case of a direction change, the velocity is simply
that since the last tracker.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 22 Apr 2015 01:46:57 +0000 (11:46 +1000)]
filter: up the motion timeout to 1 second
This timeout defines how far back in the events we search for velocity
calculations. For really slow movements, 300ms is not enough. It causes the
velocity to be 0 -> accel factor of 0 -> no movement.
As a result, really slow movement does not move the cursor.
Up the timeout to 1 second instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 30 Apr 2015 05:23:34 +0000 (15:23 +1000)]
filter: pass last_velocity as argument
Let the caller set the various fields, here we just calculate stuff.
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 1 Jun 2015 04:38:29 +0000 (14:38 +1000)]
evdev: use the button down time for no-scroll middle button press event
When we get the release event within the timeout, we send a press + release
event for the middle button. Rather than using the release event's timestamp
for both, remember and use the button press timestamp.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 1 Jun 2015 06:58:37 +0000 (16:58 +1000)]
configure.ac: libinput 0.16.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:57:18 +0000 (08:57 +1000)]
doc: add a FAQ page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 23:33:07 +0000 (09:33 +1000)]
README: add two diagrams to outline the stack
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:12:33 +0000 (08:12 +1000)]
COPYING: note that having linux/input.h in the tree does not make libinput GPL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Sat, 30 May 2015 01:40:25 +0000 (18:40 -0700)]
test: address gcc warnings on potentially uninitialized variables.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Fri, 29 May 2015 02:01:01 +0000 (19:01 -0700)]
Add xasprintf to avoid use of undefined pointer values
If asprintf fails for any reason, the contents of the pointer
are undefined. While some platforms set it to NULL, there is no
guarantee that all will.
This change adds a simple wrapper to ensure proper NULL results
on failure.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Added LIBINPUT_PRINTF attribute and the required declaration for it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jon A. Cruz [Sun, 31 May 2015 22:09:26 +0000 (08:09 +1000)]
Add missing config.h includes
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 29 May 2015 01:11:56 +0000 (11:11 +1000)]
evdev: use the udev ID_INPUT_POINTINGSTICK property
Added in systemd 220, but note that for udev backwards compatibility, the
ID_INPUT_POINTINGSTICK tag is set in addition to the ID_INPUT_MOUSE tag.
And use that property to tag a device as trackpoint too, this allows temporary
workarounds for kernel bugs where the input prop isn't set yet.
https://bugzilla.redhat.com/show_bug.cgi?id=1225563
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 28 May 2015 21:29:07 +0000 (07:29 +1000)]
test: add another wait loop for udev
Wait after deleting a device so udev can catch up with everything and the
various hooks to make sure it's happy with any newly created devices after
this.
The sleep is in the delete path to also cover the tests where we manually
create uinput devices rather than using the litest hooks.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 28 May 2015 03:41:58 +0000 (13:41 +1000)]
touchpad: check touchpad for basic features we expect
If a relative device is tagged by udev as ID_INPUT_TOUCHPAD we need to
catch this before we try to dereference device->abs.absinfo_x.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 29 May 2015 02:13:02 +0000 (12:13 +1000)]
tools: print symbolic key names too from event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 28 May 2015 03:33:54 +0000 (13:33 +1000)]
test: don't abort if the device filter filtered all devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:04:42 +0000 (08:04 +1000)]
README: spice up the readme a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 28 May 2015 01:54:34 +0000 (11:54 +1000)]
doc: improve the T440 documentation a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 28 May 2015 00:46:02 +0000 (10:46 +1000)]
doc: add illustrations for clickfinger and software button behavior
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:53:00 +0000 (08:53 +1000)]
doc: add a blurb about scroll sources to the scrolling docs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 22:23:59 +0000 (08:23 +1000)]
Update Red Hat's copyright
Updated to 2015 where appropriate, added where missing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 27 May 2015 08:29:26 +0000 (18:29 +1000)]
touchpad: add missing break statement
No effect since it was the last case, but it's more correct.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 May 2015 06:32:42 +0000 (16:32 +1000)]
touchpad: touches after the last key press can be released
The current code labels a touch as palm if it started within the typing
timeouts. To move the pointer even after the timeout expires, a user has to
lift the finger which is quite annoying and different to the old synaptics
driver behaviour (which had a simple on/off toggle on whether to let events
through or not).
Be smarter about this: if a touch starts _after_ the last key press event,
release it for pointer motion once the timeout expires. Touches started before
the last key press remain labelled as palms. This makes it possible to rest
the palm on the touchpad while typing without getting interference but also
provides a more responsive UI when moving from typing to using the touchpad
normally.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Mon, 25 May 2015 06:02:56 +0000 (16:02 +1000)]
touchpad: don't enable edge palm detection on Wacom touchpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Mon, 25 May 2015 01:36:34 +0000 (11:36 +1000)]
touchpad: reset the touch state when edge scrolling is stopped
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Fri, 22 May 2015 05:14:04 +0000 (15:14 +1000)]
touchpad: add palm state debugging
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Thu, 21 May 2015 03:30:24 +0000 (13:30 +1000)]
touchpad: split disable-while-typing handling into a helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Thu, 21 May 2015 06:58:27 +0000 (16:58 +1000)]
test: add disable-while-typing tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Fri, 22 May 2015 06:07:10 +0000 (16:07 +1000)]
touchpad: be finer-grained about when to pair touchpads/keyboard for DWT
Check a couple of easy yes/no definitives that cover most Lenovo laptops,
and avoid false positives on Wacoms.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Fri, 22 May 2015 05:51:18 +0000 (15:51 +1000)]
touchpad: only check keyboards for disable-while-typing
The keyboard test is a simple one, if we have the first row of alphabetic
keys, we assume it's a full keyboard.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Fri, 22 May 2015 05:16:31 +0000 (15:16 +1000)]
touchpad: add helper function to get from tp to the libinput context
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Sun, 24 May 2015 22:48:25 +0000 (08:48 +1000)]
touchpad: extend the key blacklist for disable-while-typing
Alt-tab should not trigger the disable-while-typing timeout, likewise with the
F-keys, multimedia keys, the windows and menu key, etc.
https://bugs.freedesktop.org/show_bug.cgi?id=90613
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Mon, 25 May 2015 00:07:51 +0000 (10:07 +1000)]
touchpad: move disable-while-typing into its own struct
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Peter Hutterer [Tue, 26 May 2015 00:44:16 +0000 (20:44 -0400)]
test: add an extra loop for slow udev initialization
On slower machines, e.g. VMs, udev isn't fast enough to get the properties set
up by the time we're trying to get the device going. This fails when we try to
add the device with libinput_path_add_device().
We know that all litest devices will have ID_INPUT set, so check for that
before we continue.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 25 May 2015 22:49:04 +0000 (08:49 +1000)]
evdev: rename evdev_compare_syspath for clarity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 22:46:05 +0000 (08:46 +1000)]
Add streq() helper to use instead of strcmp() == 0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 07:27:14 +0000 (17:27 +1000)]
test: fix coverity complaint about unbounded loop
buffer tainted (from fgets()) so tighten the loop conditions a bit.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 07:04:56 +0000 (17:04 +1000)]
test: fail if fgets() from addr2line returns NULL
Found by Coverity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 06:50:54 +0000 (16:50 +1000)]
test: pclose the popened stream
Found by Coverity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 25 May 2015 06:38:12 +0000 (16:38 +1000)]
test: move litest_log/vlog up outside of HAVE_LIBUNWIND
Well, the patch looks like the HAVE_LIBUNWIND bit was moved down, which is the
same thing.
litest_log and litest_vlog are called from independent paths, we have a
compiler error otherwise.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 24 May 2015 23:06:32 +0000 (09:06 +1000)]
Add a few more exclusions to .gitignore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 24 May 2015 23:02:25 +0000 (09:02 +1000)]
Add .vimdir for libinput-specific settings
To avoid introducing broken indentations when I'm working in different
directories than the standard one add the vimdir with the local settings.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 24 May 2015 22:56:53 +0000 (08:56 +1000)]
test: fix --list for the tests
The argument worked, but the test list was empty since
b2fd428f96.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 22 May 2015 04:56:09 +0000 (14:56 +1000)]
test: fail if the filter leaves us with zero tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 22 May 2015 04:55:24 +0000 (14:55 +1000)]
test: add missing filter for function names
Was added to other places, missing from here so some tests passed the filter
despite not being selected by it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 May 2015 23:06:07 +0000 (09:06 +1000)]
Merge branch 'litest-filter-tests'
The litest-selftest has its own main method and compiles litest.c with special
flags. Use that to ifdef out the litest.c main function, and inline the
litest_run/litest_parse_args functions so gcc doesn't complain about unused
functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 01:04:13 +0000 (11:04 +1000)]
doc: drop leftovers of Check's selective test running
CK_RUN_CASE and CK_RUN_SUITE still work because we're still using check
underneath, but it's better to use the arguments.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 01:00:37 +0000 (11:00 +1000)]
test: add --filter-group argument to match test groups (suites)
Same as CK_RUN_SUITE, but supports fnmatch-like globs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 00:49:13 +0000 (10:49 +1000)]
test: add --filter-device argument
Similar to the CK_RUN_CASE environment variable, but it does support
fnmatch()-style wildcards, e.g.
./test/test-touchpad --filter-device="synaptics*"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 00:12:39 +0000 (10:12 +1000)]
test: add filtering to litest framework
Complementary to CK_RUN_SUITE and CK_RUN_CASE, this filters on actual test
function names with a simple fnmatch.
./test/test-touchpad --filter-test="*1fg_tap*"
Most of this patch is renaming litest_add_* to _litest_add_* so we can use the
macros to get at the function names.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 23:46:54 +0000 (09:46 +1000)]
test: move argument parsing into a separate function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 23:36:01 +0000 (09:36 +1000)]
test: move main() into litest
This allows us to filter things based on argv before setting up tests, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 8 May 2015 03:30:13 +0000 (13:30 +1000)]
touchpad: sync the initial touch state
Unlikely, but there's the odd chance of the first touch coming in with the
same X or Y coordinate the kernel already has internally. This would
generate a bogus delta on the second event when the touch coordinate jumps
from 0/y or x/0 to the real coordinates.
For touchpads with distance support this is a real issue since the default
value for a touch distance is > 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 8 May 2015 04:41:42 +0000 (14:41 +1000)]
evdev: sync the initial state for absolute pointer devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 8 May 2015 03:06:25 +0000 (13:06 +1000)]
evdev: sync the initial x/y position for touchscreens
Unlikely, but there's the odd chance of the first touch coming in with the
same X or Y coordinate the kernel already has internally. This would generate
a x/0 or 0/y event in libinput.
Sync the slot state on init, at least for Protocol B devices. For Protocol A
devices and mtdev, don't bother.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 05:57:11 +0000 (15:57 +1000)]
evdev: add an interface hook to suspend a device
The touchpad carries enough state around that calling release_all_keys() isn't
enough to properly suspend it. e.g. a button down after tapping won't be
released by trying to release the physical button for it.
We need to clear the state properly, but that's interface-specific so add a
new hook for it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 05:37:18 +0000 (15:37 +1000)]
evdev: move release_pressed_keys() up
Just a move to make the next diff easier
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 05:52:17 +0000 (15:52 +1000)]
touchpad: rename all interface functions for clarity
Add "interface" to the name to make things a bit clearer.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 19 May 2015 04:44:16 +0000 (14:44 +1000)]
evdev: log a bug if releasing a key fails, but don't loop forever
If a physical button is down but releasing said button doesn't actually
release it, we loop endlessly. Detect that and log a bug instead.
Reproducible: trigger a tap-n-drag on a touchpad device, then remove it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 21 May 2015 06:40:24 +0000 (16:40 +1000)]
test: add missing linebreak in debug error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jan Alexander Steffens (heftig) [Mon, 18 May 2015 13:13:23 +0000 (15:13 +0200)]
Rename MODEL_SYSTEM76_CLEVO to MODEL_CLEVO_W740SU
The System76 Galago Ultra Pro is a rebranded Clevo W740SU with changed
firmware strings. To my knowledge, the Clevo W740SU and all its rebrands
possess smooth touchpads.
In the original bug report[1], a Galago Ultra Pro was returned to the
original DMI strings by flashing another firmware. This resulted in the
model identified as MODEL_SYSTEM76_CLEVO.
Since the actual manufacturer of the W740SU is Clevo and the CLEVO hwdb
entry already properly identifies other W740SU rebrands like the Schenker
S413, the model should be renamed to match.
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=90170#c3
https://bugs.freedesktop.org/show_bug.cgi?id=90353
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 21 May 2015 01:05:45 +0000 (11:05 +1000)]
Merge branch 'litest-backtrace'
Peter Hutterer [Tue, 19 May 2015 23:21:26 +0000 (09:21 +1000)]
test: move opening { to next line
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 20 May 2015 00:57:11 +0000 (10:57 +1000)]
doc: clarify a comment what a "no device" test case means
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 06:22:14 +0000 (16:22 +1000)]
Allow disabling of middle button emulation where it doesn't exist
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 06:01:55 +0000 (16:01 +1000)]
Allow disabling tapping on a device without tapping
The doc says this "always succeeds", not "segfaults".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 00:57:27 +0000 (10:57 +1000)]
test: add a note to one of the device tests
If we get two different sysnames for the device, this test doesn't test
anything much, so it's better to fail here. But add a comment so that when it
fails it's quite obvious why.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 00:33:24 +0000 (10:33 +1000)]
test: parse the LITEST_VERBOSE environment variable
--verbose only works when running a specific test, sometimes we need make
check to be more verbose. Set this by default for make check, the log becomes
a lot more expressive that way
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 19 May 2015 00:24:36 +0000 (10:24 +1000)]
path: be more lenient waiting for udev to settle things
Running tests in parallel can exceed the current 100ms max timeout for udev to
settle things. Since this pretty much only triggers in test cases anyway,
let's be more lenient here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 18 May 2015 05:59:09 +0000 (15:59 +1000)]
test: drop unneeded includes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 May 2015 01:40:39 +0000 (11:40 +1000)]
test: convert all helper functions to use the litest macros
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 7 May 2015 23:31:44 +0000 (09:31 +1000)]
test: extract file:line from backtrace with addr2line
libunwind gives us a file and an address and usually a function name. Beyond
that, it's mostly guessing.
Fork off addr2line to resolve the addresses that libunwind gives us, if we
succeed we get a backtrace like this:
Backtrace:
0: litest_fail_comparison_int() (./test/litest.c:268)
1: disable_button_scrolling() (./test/pointer.c:115)
2: middlebutton_doubleclick() (./test/pointer.c:991)
3: /lib64/libcheck.so.0 (srunner_run+0x7f5) [0x7f6c12d8c025]
4: litest_run() (./test/litest.c:689)
5: main() (./test/pointer.c:1280)
6: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f6c11a73790]
7: ./test/test-pointer (_start+0x29) [0x403d99]
8: ? (?+0x29) [0x29]
Note: I intentionally swapped function/file name in the output to make it
easier to spot which one is fully resolved and which one is the basic
libunwind output.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 7 May 2015 22:16:39 +0000 (08:16 +1000)]
test: add pointer comparison macros
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 3 May 2015 23:13:22 +0000 (09:13 +1000)]
test: add a backtrace facility to litest
The check unit test framework isn't particularly suited to having ck_assert*
calls in helper functions. A failed assertion in a helper function or the
litest framework merely gives us a the failed line in litest.c.
which doesn't tell us which test actually failed.
Add a backtracing facility with litest_backtrace(). And since this requires
wrapping all ck_assert macros with litest_assert() this patch ended up
replacing/duplicating a bunch of ck_assert_* bits. So rather than
ck_assert_int_eq() we now use litest_assert_int_eq(), etc. in the litest
framework itself.
The int comparison macros are more type-safe than ck_assert()'s macros which
just cast all the ints to intmax_t.
Backtrace is spewed to stderr, which is good enough for debugging. Example
backtrace:
FAILED COMPARISON: status != expected
Resolved to: 0 != 0
in disable_button_scrolling() (pointer.c:115)
Backtrace:
0: ./test/test-pointer (litest_fail_comparison_int+0xab) [0x40973b]
1: ./test/test-pointer (disable_button_scrolling+0x174) [0x40421b]
2: ./test/test-pointer (middlebutton_middleclick+0x40) [0x40829c]
3: /lib64/libcheck.so.0 (srunner_run+0x7f5) [0x7f0e8a277025]
4: ./test/test-pointer (litest_run+0x107) [0x40a42b]
5: ./test/test-pointer (main+0x2fa) [0x4090e7]
6: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f0e88f5e790]
7: ./test/test-pointer (_start+0x29) [0x403ce9]
8: ? (?+0x29) [0x29]
litest_backtrace() itself is copied from xserver/os/backtrace.c which git
blame attributes to Marcin.
CC: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 5 May 2015 01:52:32 +0000 (11:52 +1000)]
test: cast to int before integer comparison
No effect with the current macros since they'll cast to int for us, but this
will change with the litest_assert macros.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 May 2015 01:29:49 +0000 (11:29 +1000)]
test: don't use enum values in ck_assert macros directly
Unfortunately, typeof(enum something) != typeof(ENUM_VALUE) and produces a
-Wsign-compare warning
Preemptively fix this, it'll show up in the upcoming litest_asssert macros
otherwise.
This fix only applies to helper functions, tests themselves wont (yet) be
switched to the new macros and don't need fixing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 4 May 2015 01:27:25 +0000 (11:27 +1000)]
test: type-safe two ck_assert invocations
unsigned vs signed in both cases, but the ck_assert macros hide that
(everything is cast to intmax_t). The upcoming litest_assert wrappers expose
these warnings, so fix them ahead of time.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>