Peter Hutterer [Tue, 8 Dec 2015 23:08:10 +0000 (09:08 +1000)]
configure.ac: libinput 1.1.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 4 Dec 2015 05:52:17 +0000 (15:52 +1000)]
touchpad: don't set the axis for a 0.0 value in a scroll event
Once we trigger diagonal scrolling, the device's scroll direction is set as
horiz+vert. From then on, both axes will be set on every subsequent scroll
event, even when the actual delta for an axis is 0.
This causes continuous scroll stop events in clients that care about these
things.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 7 Dec 2015 01:39:52 +0000 (11:39 +1000)]
test: always call libinput_dispatch after moving touches
We dont' want to fill up the event queue and cause SYN_DROPPED events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 4 Dec 2015 05:58:16 +0000 (15:58 +1000)]
tools: print which scroll axis we have in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 2 Dec 2015 00:36:30 +0000 (10:36 +1000)]
touchpad: don't try to position fake touches when no fingers are down
If all fingers are released in the same frame, we won't be able to find the
top-most touch.
https://bugs.freedesktop.org/show_bug.cgi?id=93204
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 1 Dec 2015 23:48:01 +0000 (09:48 +1000)]
test: if we're hovering, don't send BTN_TOUCH
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 1 Dec 2015 23:27:22 +0000 (09:27 +1000)]
test: abort if we have a test that doesn't run for any devices
If the test is filtered out and we never run it generates a false positive.
Though it isn't listed in the "Checks" summary this is a bit hard to tell when
you're running >700 tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 26 Nov 2015 01:51:20 +0000 (11:51 +1000)]
Ignore BTN_TOOL_* events when posting button events
These aren't real button events and they are handled elsewhere, either through
proper touch events on touchscreen or through custom handling in the touchpad
case.
https://bugs.freedesktop.org/show_bug.cgi?id=93165
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 2 Dec 2015 00:12:48 +0000 (10:12 +1000)]
Add a missing closing ) in a comment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 9 Nov 2015 06:21:36 +0000 (16:21 +1000)]
touchpad: reduced the 2fg scroll threshold to 1mm
At least on the t440, this is enough to trigger correct detection between
pinch and scroll 90% of the time. Since scrolling is significantly more
prevalent than gesturing, erring on the side of scrolling at the cost of
misdetecting some gestures is acceptable.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Sun, 15 Nov 2015 22:36:23 +0000 (08:36 +1000)]
configure.ac: libinput 1.1.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 15 Nov 2015 21:44:12 +0000 (07:44 +1000)]
doc: add a link to the dwt config call to the doc
And link the software buttons sentence to the t440 page.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 9 Nov 2015 05:42:06 +0000 (15:42 +1000)]
tools: take the start time before initializing the context
Otherwise events that are already queued before the first libinput_dispatch()
have a negative timestamp.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 9 Nov 2015 00:18:17 +0000 (10:18 +1000)]
test: add a device to check MOUSE_WHEEL_CLICK_ANGLE handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tomi Leppänen [Thu, 17 Sep 2015 12:05:25 +0000 (15:05 +0300)]
Documentation fixes to arrows in svg files
There were two files (doc/svg/{edge,twofinger}-scrolling.svg) that had both
arrow heads pointing to wrong direction. Those arrow heads used markers but
their ids were defined wrong and therefore they displayed weirdly. On Firefox
the arrow head that should have pointed to left pointed actually to right.
This commit fixes that problem by defining the marker ids correctly.
I tested on Firefox 40.0.3 that the arrow heads are now displayed correctly.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 1 Nov 2015 22:46:25 +0000 (08:46 +1000)]
Fix libinput_device_group_find_group() to return NULL on failure
struct list isn't a null-terminated list, list_for_each() causes 'g' to be set
to the list head at the end of the loop. Returning that as group caused random
memory to be overwritten.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 27 Oct 2015 23:13:24 +0000 (09:13 +1000)]
evdev: init pointer acceleration for any device with pointer cap and rel x/y
The Asus RoG Gladius exposes two event nodes, one mouse, one keyboard. The
keyboard node has REL_X/Y and REL_HWHEEL on top of the various key bits and
ABS_VOLUME.
The keyboard node does not have BTN_* set, udev tags this device as a
keyboard only, not as a pointer but we still initialize the pointer caps for
it because of the wheel.
When moving this mouse, some deltas (ca "1 in every 20") are sent through the
keyboard node, causing a crash because we never initialized pointer
acceleration.
https://bugzilla.redhat.com/show_bug.cgi?id=
1275407
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 27 Oct 2015 23:05:37 +0000 (09:05 +1000)]
evdev: don't handle motion events if the device isn't a pointer device
This check is already in place for all other event types.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 27 Oct 2015 23:20:33 +0000 (09:20 +1000)]
evdev: log a bug for missing pointer accel on relative events
And use the unaccelerated motion events. Better than crashing, and better than
a non-moving mouse.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 27 Oct 2015 23:18:18 +0000 (09:18 +1000)]
evdev: whitespace fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 26 Oct 2015 00:44:36 +0000 (10:44 +1000)]
configure.ac: libinput 1.1.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 17 Sep 2015 23:14:43 +0000 (09:14 +1000)]
touchpad: fix the number of button clicks in multitap
tap-tap-down-move should emit 1 click + press, not 2 clicks + press
https://bugs.freedesktop.org/show_bug.cgi?id=92016
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 10 Sep 2015 17:25:21 +0000 (03:25 +1000)]
configure.ac: bump to 1.0.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Aug 2015 03:13:47 +0000 (13:13 +1000)]
Add an API to change pointer acceleration profiles
The quartett of new config functions is:
libinput_device_config_accel_get_profiles
libinput_device_config_accel_get_profile
libinput_device_config_accel_set_profile
libinput_device_config_accel_get_default_profile
The profile defines how the pointer acceleration works, from a very high-level
perspective. Two profiles are on offer, "adaptive", the standard one we have
used so far and "flat" which is a simple multiplier of input deltas and
provides 1:1 mapping of device movement vs pointer movement.
The speed setting is on top of the profile, a speed of 0 (default) is the
equivalent to "no pointer acceleration". This is popular among gamers and
users of switchable-dpi mice.
The flat profile unnormalizes the deltas, i.e. you get what the device does
and any device below 800dpi will feel excruciatingly slow. The speed range
[-1, 1] maps into 0-200% of the speed. At 200%, a delta of 1 is translated
into a 2 pixel movement, anything higher makes it rather pointless.
The flat profile is currently available for all pointer devices but touchpads.
https://bugs.freedesktop.org/show_bug.cgi?id=89485
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 4 Sep 2015 02:56:41 +0000 (12:56 +1000)]
Fix leaking device groups
If a caller has a reference to a device group when the context is destroyed,
the memory for the group is never released. Calling
libinput_device_group_unref() will release it and there are no side-effects
since the group has no back-references. It's inconsistent with the rest of
libinput though - all other resources get released on libinput_unref().
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Mon, 7 Sep 2015 05:07:54 +0000 (15:07 +1000)]
test: re-enable the abort-on-bug log handler
This was accidentally disabled in
6953b51b7ebe079b9432244. We want to fail
when a bug is exposed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 31 Aug 2015 01:10:58 +0000 (11:10 +1000)]
touchpad: don't tap for 2fg down, followed by a single finger up
The following sequence currently generates a right-button event:
finger 1 down
finger 2 down
finger 1 up
finger 2 held down
This is easily triggered with short scroll events. There are two issues here:
first is that the tapping code elsewhere treats any tap with a second finger
down as a left-button tap, not a right button one. So if anything, we should
generate a left button click here, not a right button click.
Arguably, generating a button click here is wrong though, it's not a very well
defined sequence and relatively difficult to trigger intentionally. So the
best solution here is to simply ignore the release event and move straight
back to state HOLD - unless the second finger is released within the timeout.
If the finger is set down again during the timeout, we move straight to
TOUCH_2_HOLD - this could eventually be interpreted as a tap, but not for now.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Andreas Pokorny [Fri, 4 Sep 2015 11:35:01 +0000 (13:35 +0200)]
fix gcc warning on unused return value
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 4 Sep 2015 03:55:48 +0000 (13:55 +1000)]
Note that libinput_unref() really destroys everything
This is both a bug and required behavior. A caller may hold refcounted
references to devices, seats, or device groups but when libinput_unref()
cleans up, all these become invalid.
It is required behavior, because the last call to libinput_unref() also calls
libinput_suspend() and thus stops any events.
Any attempt at fixing this will break current behavior:
* keeping structs until all refcounts are 0 may leak memory in current
callers
* it would require an explicit call to libinput_suspend(), or make
libinput_unref() inconsistent in its behavior.
So we document it as a bug and tell people not to do it.
https://bugs.freedesktop.org/show_bug.cgi?id=91872
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Mon, 31 Aug 2015 22:11:58 +0000 (08:11 +1000)]
evdev: ignore accelerometer devices
https://bugs.freedesktop.org/show_bug.cgi?id=91563
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 31 Aug 2015 04:05:11 +0000 (14:05 +1000)]
filter: fix constant acceleration for the X230
The x230 has a special acceleration method that relies on the touchpad magic
slowdown. This was missing from commit
c8da19b50a30d8, making two-finger
scroll motions unusably fast
https://bugs.freedesktop.org/show_bug.cgi?id=91819
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Andreas Pokorny [Thu, 20 Aug 2015 11:43:40 +0000 (13:43 +0200)]
libinput: litest shall only emit auto assign events when replaced
With this change auto assign events will be skipped if no replacement value
is provided. This behavior is practical when emitting mt events, as those
only contain the axis values that changed.
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Aug 2015 00:43:07 +0000 (10:43 +1000)]
configure.ac: libinput 1.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 23 Aug 2015 23:35:40 +0000 (09:35 +1000)]
doc: add a diagram for evemu and note that libinput doesn't recordings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jason Gerecke [Fri, 21 Aug 2015 15:42:54 +0000 (08:42 -0700)]
doc: fix more typos
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Andreas Pokorny [Thu, 20 Aug 2015 10:51:37 +0000 (12:51 +0200)]
test: fix gcc warning about missing prototypes
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Andreas Pokorny [Thu, 20 Aug 2015 08:31:47 +0000 (10:31 +0200)]
doc: ellipse instead of ellipsis
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Andreas Pokorny [Thu, 20 Aug 2015 08:33:32 +0000 (10:33 +0200)]
doc: inverse event type restriction of x and y accessors
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 17 Aug 2015 03:15:01 +0000 (13:15 +1000)]
configure.ac: libinput 1.0RC1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 6 Aug 2015 04:59:38 +0000 (14:59 +1000)]
touchpad: use unaccelerated motion data for scrolling
For short and quick scroll gestures, those that should only trigger a few
lines of scroll the pointer acceleration is wildly unpredictable. Since we
average the motion of both fingers it's hard enough to intuitively predict
what the motion will be like. On top of that is the small threshold before we
start scrolling, so some of the initial motion gets swallowed before we
accelerate, making the next motion even more unpredictable.
The end result is that multiple seemingly identical finger motions cause
wildly different scroll motion.
Drop pointer acceleration for two-finger and edge scrolling. This makes short
scroll motions much more predictable and doesn't seem to have much effect on
long scroll motions. Plus, in natural scroll mode it really feels like the
content is stuck to your fingers now. Go wash your hands.
https://bugzilla.redhat.com/show_bug.cgi?id=
1249365
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 17 Aug 2015 06:32:20 +0000 (16:32 +1000)]
filter: add a "filter_constant" hook to the filter interface
For when we need to apply some transformation to the data but it shouldn't be
acceleration. Example use are touchpad coordinates, even when not
accelerating, we still want to apply the magic slowdown.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 17 Aug 2015 23:11:48 +0000 (09:11 +1000)]
filter: move the TP_MAGIC_SLOWDOWN to a single definition
Requires splitting out the X230 one so we don't accidentally break things if
we ever change this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 17 Aug 2015 06:17:41 +0000 (16:17 +1000)]
filter: use named initalizers for the accelerator interface
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 17 Aug 2015 22:47:28 +0000 (08:47 +1000)]
test: fix edge scroll timeout test
This test is supposed to test for the timeout kicking in on edge scrolling -
if the finger is in the edge for longer than the timeout, we switch to
scrolling without requiring the motion threshold to be met first.
To emulate this, move the finger ever so slightly first to load up the motion
history, then timeout, then move. We expect a bunch of motion events with a
small delta.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 17 Aug 2015 04:14:33 +0000 (14:14 +1000)]
test: use the touchpad size for the 7mm movement
Makes the code more straightforward, and we now require the devices to
have a height/width anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 19 Aug 2015 05:21:53 +0000 (15:21 +1000)]
Add log_*_ratelimit wrappers
Don't open-code the rate-limited log messages, use a simple wrapper instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 19 Aug 2015 04:39:59 +0000 (14:39 +1000)]
Drop obsolete unused declarations for log_info/set_logging_enabled
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 18 Aug 2015 22:51:58 +0000 (08:51 +1000)]
Change a fprintf to log_error
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 18 Aug 2015 05:46:41 +0000 (15:46 +1000)]
tools: fix switch statement indentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 18 Aug 2015 03:00:15 +0000 (13:00 +1000)]
evdev: drop relative x/y motion from a device not marked as pointer
A device with REL_X/Y and keys gets marked only as ID_INPUT_KEY, initializes
as keyboard and then segfaults when we send x/y coordinates - pointer
acceleration never initializes.
Ignore the events and log a bug instead. This intentionally only papers over
the underlying issue, let's wait for a real device to trigger this and then
look at the correct solution.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 17 Aug 2015 05:56:50 +0000 (15:56 +1000)]
doc: fix typos
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 16 Aug 2015 23:27:48 +0000 (09:27 +1000)]
Merge branch 'filter-us-ms-cleanup'
Peter Hutterer [Wed, 27 May 2015 03:02:52 +0000 (13:02 +1000)]
test: add a comment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Aug 2015 04:47:59 +0000 (14:47 +1000)]
tools: add shell script for making the pointer acceleration graphs in the docs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Wed, 29 Jul 2015 05:05:52 +0000 (15:05 +1000)]
doc: add pointer acceleration documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Fri, 31 Jul 2015 02:29:23 +0000 (12:29 +1000)]
tools: allow filter-switching in ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 28 Jul 2015 06:02:05 +0000 (16:02 +1000)]
filter: split trackpoint acceleration out
This is step one to fixing trackpoint acceleration, separating it from the
other acceleration code. No functional changes yet, it still uses the low-dpi
accel method.
https://bugs.freedesktop.org/show_bug.cgi?id=91369
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 28 Jul 2015 05:53:23 +0000 (15:53 +1000)]
filter: duplicate the code for the Lenovo x230 accel method
This is "once-tested, don't touch it again" code. The quirks on the touchpad
means we'd have to find that specific device again and re-test everything if
we change anything elsewhere in the code. So duplicate it properly, so that we
don't have to touch it again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 11 Aug 2015 02:40:45 +0000 (12:40 +1000)]
touchpad: enable natural scrolling for edge scrolling
Instead of going straight to pointer_notify_axis, go through
evdev_notify_axis() which flips the scroll direction around for us.
https://bugs.freedesktop.org/show_bug.cgi?id=91597
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 28 Jul 2015 05:49:22 +0000 (15:49 +1000)]
filter: split out handling of the low-dpi accel method
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 28 Jul 2015 05:46:33 +0000 (15:46 +1000)]
filter: split calculating the accel factor into a helper function
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 28 Jul 2015 05:06:13 +0000 (15:06 +1000)]
filter: revamp to create device-specific filters, rather than accel functions
The previous approach to pointer acceleration was to initialize the same
motion filter behavior but a different acceleration profile depending on the
hardware (the profile converts a speed to a multiplier for input deltas).
To be more flexible for hardware-specifics, change this into a set of specific
pointer acceleration init functions. This patch has no effective functional
changes, they're still all the same.
The acceleration functions are kept for direct access by the ptraccel-debug
tool.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 28 Jul 2015 04:45:51 +0000 (14:45 +1000)]
filter: move create_pointer_accelerator_filter down in the file
No functional changes, just moving code in preparation for filter patches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 28 Jul 2015 05:39:19 +0000 (15:39 +1000)]
filter: drop accel->last, write-only value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Wed, 5 Aug 2015 03:39:33 +0000 (13:39 +1000)]
filter: explain the acceleration function in detail
And switch to a code-flow that's a bit more self-explanatory than the current
min/max combinations.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 4 Aug 2015 06:04:06 +0000 (16:04 +1000)]
filter: add two helper functions to convert between speeds
This makes it more obvious where we're using units/us and units/ms as input
variable and what the output is. Clutters up the code, but still better than
dealing with us/ms differently per function, and still better than carrying
all the 1000.0 multiplications/divisions manually.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 4 Aug 2015 06:01:20 +0000 (16:01 +1000)]
filter: rename speed_out to "factor" for the touchpad profiles
The return value of a profile is a unitless factor, not a speed.
Same applies for s1/s2, these are factors, not speeds.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 4 Aug 2015 05:48:40 +0000 (15:48 +1000)]
filter: rename speed to speed_adjustment where it's in the [-1,1] range
To avoid confusion with the other speed in units/time
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 4 Aug 2015 05:47:39 +0000 (15:47 +1000)]
filter: drop superfluous struct declaration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 4 Aug 2015 05:45:53 +0000 (15:45 +1000)]
Revert "filter: move the pointer acceleration profiles back to units/ms"
This reverts commit
8a6825f1602aa9d9c4b29a83d296f55f68b316e0.
Aside from introducing bugs, this doesn't really help with anything, it adds a
requirement to rename everything to make clear where we're using µs and where
we're using ms and that just clutters up the code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Wed, 5 Aug 2015 00:55:39 +0000 (10:55 +1000)]
evdev: split scroll threshold and direction lock threshold into two
The previous code used a 5mm threshold before axis events were posted. This
threshold was on top of the 2mm 2fg threshold (and timeout handling) in the
gesture code and effectively prevented events from being sent after a timeout,
or in the 2mm-5mm range.
We still want a directional lock though, so split the two out. The default 5mm
threshold is set to 0 for touchpads since we have our own handling of the
threshold there. The directional lock only applies once scrollin has started
and remains on 5mm.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 4 Aug 2015 21:37:03 +0000 (07:37 +1000)]
udev: use prop_value() to fetch the ID_INPUT_PROP property
This will thus work if the property is only set on a parent device, not on the
device directly.
https://github.com/systemd/systemd/issues/763
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Jackie Huang [Wed, 5 Aug 2015 03:28:43 +0000 (11:28 +0800)]
configure.ac: add arg --with-libunwind
Add arg --with-libunwind for configure so it's optional to check
libunwind, which is helpfull to make deterministic builds.
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 4 Aug 2015 23:45:45 +0000 (09:45 +1000)]
test: don't try to print axis values that aren't set
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 4 Aug 2015 05:08:25 +0000 (15:08 +1000)]
filter: fix acceleration threshold assignment
The new values were in units/us and didn't make the switch back to ms in
8a6825f1602.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Mon, 3 Aug 2015 04:38:38 +0000 (14:38 +1000)]
middle-button: don't call libinput_now() in the timeout handler
The argument has "now" already
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 4 Aug 2015 00:09:43 +0000 (10:09 +1000)]
configure.ac: libinput 0.21.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>
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>
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>
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>
Peter Hutterer [Mon, 3 Aug 2015 01:40:37 +0000 (11:40 +1000)]
Merge branch 'disable-gestures-semi-mt'
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>