Commit graph

1520 commits

Author SHA1 Message Date
Andreas Pokorny
6dcbc99499 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>
2015-09-07 07:41:41 +10:00
Peter Hutterer
47aafeb4bc 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>
2015-09-04 15:51:12 +10:00
Peter Hutterer
f0fa590394 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>
2015-09-01 08:20:03 +10:00
Peter Hutterer
6a0f9411f2 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 c8da19b50a, 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>
2015-08-31 14:05:11 +10:00
Andreas Pokorny
58f25a47ed 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>
2015-08-26 14:46:49 +10:00
Peter Hutterer
8215d725d0 configure.ac: libinput 1.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-26 10:43:07 +10:00
Peter Hutterer
84318021c0 doc: add a diagram for evemu and note that libinput doesn't recordings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-24 09:36:22 +10:00
Jason Gerecke
7095b765ac doc: fix more typos
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-22 16:03:29 +10:00
Andreas Pokorny
4c8f8a7ea2 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>
2015-08-21 11:45:56 +10:00
Andreas Pokorny
d0ae1d99b3 doc: ellipse instead of ellipsis
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-21 11:44:25 +10:00
Andreas Pokorny
a2c9787a8b 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>
2015-08-21 11:44:15 +10:00
Peter Hutterer
9c4241ca82 configure.ac: libinput 1.0RC1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 08:42:30 +10:00
Peter Hutterer
c8da19b50a 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>
2015-08-20 07:57:14 +10:00
Peter Hutterer
d8c37a94c0 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>
2015-08-20 07:57:14 +10:00
Peter Hutterer
e4fd60ce5e 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>
2015-08-20 07:57:14 +10:00
Peter Hutterer
dac38a0828 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>
2015-08-20 07:57:14 +10:00
Peter Hutterer
168c61920c 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>
2015-08-20 07:57:14 +10:00
Peter Hutterer
c7b11644c6 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>
2015-08-20 07:57:14 +10:00
Peter Hutterer
b88fd37593 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>
2015-08-20 07:57:03 +10:00
Peter Hutterer
2e7a585faa Drop obsolete unused declarations for log_info/set_logging_enabled
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 07:57:03 +10:00
Peter Hutterer
6d26728a16 Change a fprintf to log_error
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 07:57:03 +10:00
Peter Hutterer
42f482b43d tools: fix switch statement indentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-20 07:57:03 +10:00
Peter Hutterer
6953b51b7e 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>
2015-08-20 07:56:59 +10:00
Peter Hutterer
5311d76ec1 doc: fix typos
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-17 16:26:43 +10:00
Peter Hutterer
f976619ebd Merge branch 'filter-us-ms-cleanup' 2015-08-17 09:27:48 +10:00
Peter Hutterer
e2b5f0abb6 test: add a comment
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-12 15:38:02 +10:00
Peter Hutterer
cd63a06153 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>
2015-08-12 14:06:00 +10:00
Peter Hutterer
9424fb6f99 doc: add pointer acceleration documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-12 14:06:00 +10:00
Peter Hutterer
e1849b3e58 tools: allow filter-switching in ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-12 14:06:00 +10:00
Peter Hutterer
4c1c572b19 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>
2015-08-12 14:06:00 +10:00
Peter Hutterer
e1be2f54ca 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>
2015-08-12 14:06:00 +10:00
Peter Hutterer
0cd54c5987 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>
2015-08-12 08:33:02 +10:00
Peter Hutterer
ef3f234345 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>
2015-08-11 09:19:55 +10:00
Peter Hutterer
f2663e2b25 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>
2015-08-11 09:19:55 +10:00
Peter Hutterer
4c48b46d15 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>
2015-08-11 09:19:55 +10:00
Peter Hutterer
4cdcf5cc38 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>
2015-08-11 09:19:55 +10:00
Peter Hutterer
5ec449f7dc filter: drop accel->last, write-only value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-11 09:19:55 +10:00
Peter Hutterer
723dccfd93 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>
2015-08-11 09:19:55 +10:00
Peter Hutterer
1cbcc641a0 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>
2015-08-11 09:12:37 +10:00
Peter Hutterer
7db8884ff5 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>
2015-08-11 08:37:20 +10:00
Peter Hutterer
b750c7d69f 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>
2015-08-11 08:37:18 +10:00
Peter Hutterer
c0a1d22fea filter: drop superfluous struct declaration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-11 08:35:52 +10:00
Peter Hutterer
cbff01daf1 Revert "filter: move the pointer acceleration profiles back to units/ms"
This reverts commit 8a6825f160.

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>
2015-08-11 08:35:47 +10:00
Peter Hutterer
3dd0ece9c0 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>
2015-08-11 07:49:45 +10:00
Peter Hutterer
05ce472a05 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>
2015-08-11 07:49:42 +10:00
Jackie Huang
74236f1047 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>
2015-08-07 11:37:38 +10:00
Peter Hutterer
2ee2bebb34 test: don't try to print axis values that aren't set
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-05 11:28:32 +10:00
Peter Hutterer
254f87564f filter: fix acceleration threshold assignment
The new values were in units/us and didn't make the switch back to ms in
8a6825f160.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-04 16:11:01 +10:00
Peter Hutterer
317cd252be 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>
2015-08-04 15:44:39 +10:00
Peter Hutterer
603ac39e3b configure.ac: libinput 0.21.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-04 10:26:43 +10:00