Commit graph

1715 commits

Author SHA1 Message Date
Peter Hutterer
30dbd6718a test: ensure proximity out coordinates are the ones from the last axis event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-12 06:52:51 +10:00
Peter Hutterer
003e9b14d7 tablet: rename STYLUS_IN_CONTACT to TOOL_IN_CONTACT
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-12 06:52:51 +10:00
Peter Hutterer
480a72829a tablet: clarify tablet axis behavior in regards to proximity
We send the axis state in the proximity event so we don't send another axis
event for the same state. The first axis event is sent whenever the tool
moves. This is largely of note for test cases, in real-world usage a tool
cannot be held still enough to never send axis updates.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-12 06:52:51 +10:00
Peter Hutterer
f035def401 test: add printing of tablet events to litest
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-11 15:32:51 +10:00
Peter Hutterer
4ca8f3b699 tools: print the tool ID in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-09 15:39:20 +10:00
Peter Hutterer
368ced1f29 tablet: widen the tool id to 64 bits
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-09 15:38:55 +10:00
Peter Hutterer
87926e4ab6 tablet: rename all tool types to LIBINPUT_TOOL_TYPE_*
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-09 15:37:22 +10:00
Peter Hutterer
9d07f8af40 tools: add tablet support to event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-05 14:37:29 +10:00
Peter Hutterer
4ae64a3436 tablet: allow tablet_get_x/y_transformed for proximity events as well
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-05 14:35:52 +10:00
Peter Hutterer
548ad08909 tablet: restrict tablet_axis_has_changed to axis/proximity events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-05 14:35:00 +10:00
Peter Hutterer
19812f599e tablet: use require_event_type instead of direct type check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-05 14:33:58 +10:00
Peter Hutterer
4edcd79372 tablet: widen the serial type to uint64_t
Internally we still use uint32_t because that's all we get from evdev. But
eventually we'll have 64 bit serials.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-05 13:18:33 +10:00
Peter Hutterer
ab6a409cdc Merge branch 'master' into tablet-support 2015-10-21 19:19:01 +10:00
Peter Hutterer
d92ae62dad 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>
2015-09-19 02:03:37 +10:00
Peter Hutterer
1d0a1d57e2 configure.ac: bump to 1.0.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-11 03:25:21 +10:00
Peter Hutterer
8d9e7a1bcf 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>
2015-09-11 00:54:01 +10:00
Peter Hutterer
0c7ef582eb 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>
2015-09-10 01:11:06 +10:00
Peter Hutterer
252869c949 test: re-enable the abort-on-bug log handler
This was accidentally disabled in 6953b51b7e. We want to fail
when a bug is exposed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-09-07 15:07:54 +10:00
Peter Hutterer
79570fd492 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>
2015-09-07 07:55:32 +10:00
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
8fe7f08e85 Merge branch 'master' into tablet-support 2015-08-26 14:24:16 +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
4968053025 test: add test for the tablet usec API
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-12 15:50:38 +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