Commit graph

448 commits

Author SHA1 Message Date
Peter Hutterer
29ba32b330 0.13.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlURAX0ACgkQ4jt+cLRn8L9oeQCfUkFNZCSYwEGiuBQfx6wgGfBD
 vWgAoLiQ7zVV5Vko9NE4Lu4hPkt7UQ21
 =LvzY
 -----END PGP SIGNATURE-----

Merge tag '0.13.0' into tablet-support
2015-04-07 07:52:43 +10:00
Hans de Goede
254f4f255f Change vector_get_direction input to a normalized_coords struct
Change vector_get_direction input to a normalized_coords type rather than
passing in a separate x,y pair, and rename it normalized_get_direction to
match. Since it now depends on the normalized_coords type which gets declared
in libinput-private.h also move it to libinput-private.h .

Note this commit also contains a functional change wrt the get_direction
usuage in the palm detection. The palm-detection code was calling get_direction
on non normalized coordinates, this commits changes the code to normalize
the coordinates first. This is the right thing to do as calling get_direction
on non normalized coordinates may result in a wrong direction getting returned
when the x and y resolution of the touchpad are not identical.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-27 14:44:36 +01:00
Hans de Goede
209215946b Rename delta_coords to device_float_coords
What we really need is not a specific delta type, but a type which can hold
non discrete device coordinates, this is e.g. also needed for the center
coordinates of gestures. So rename delta_coords to device_float_coords to
properly reflect what we really need.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-27 14:44:18 +01:00
Hans de Goede
9f353b6678 Change tp_filter_motion to normalized_coords
Change tp_filter_motion to use normalized_coords, rather then having it take
separate x and y values.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-25 15:16:41 +01:00
Hans de Goede
b87251ca71 Add a normalized_is_zero helper function
Add a normalized_is_zero helper function, and use it where applicable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-25 15:16:41 +01:00
Hans de Goede
fe93145f86 Add a delta_coords type and use it were applicable
tp_normalize_coords is one of the last functions taking separate x, y
values rather a coordinate pair, this commit cleans this up.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-25 09:18:55 +10:00
Peter Hutterer
ee376b0b56 Revert "touchpad: parse the TOUCHPAD_RESOLUTION property"
This reverts commit 0e64837f30.

Rather than a customized touchpad property, let udev handle this and set the
absinfo struct during the normal setup procedures. No need for libinput to
have a custom workaround here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-20 11:09:05 +10:00
Peter Hutterer
69d5bbbeba filter: switch to normalized_coords
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-19 12:06:48 +10:00
Peter Hutterer
ea1c39f702 Revert "touchpad: force a resolution onto the apple touchpads"
This reverts commit d101d43dd0.

This commit was accidentally merged, it was sitting on top of the wip branch.
With the 0e64837f30 commit this isn't necessary
anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-03-19 08:11:42 +10:00
Peter Hutterer
2876575d06 Merge branch 'master' into tablet-support 2015-03-18 14:37:46 +10:00
Peter Hutterer
d101d43dd0 touchpad: force a resolution onto the apple touchpads
A large range of the Apple touchpads seem to have the same dimensions. Use
that fact to force-set a resolution.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-18 08:39:05 +10:00
Peter Hutterer
0e64837f30 touchpad: parse the TOUCHPAD_RESOLUTION property
Not all touchpad kernel drivers supply the x/y resolution. Let the udev hwdb
fix this up where possible and read the value from it.

This is intentionally only used on touchpads, touchscreen devices without
resolution should be considered buggy and fixed in the kernel.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-17 15:13:55 +10:00
Peter Hutterer
522a42e9b4 Push the touchpad magic slowdown to the touchpad accel code
This way the unaccelerated deltas returned by libinput are correct.

To maintain the current behavior we slow down the input speed by the magic
factor and likewise the accelerated output speed. This produces virtually the
same accelerated deltas as the previous code.

The magic factor is applied to the default denominator for guessing a
resolution based on the touchpad diagonal. We can't really get around this
without having a resolution from the touchpad; meanwhile this produces
virtually the same coordinates before/after.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-17 15:13:55 +10:00
Peter Hutterer
1884ee186e touchpad: simplify resolution check
The struct evdev_device's absinfo_x/y point to the right axis

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-17 10:32:08 +10:00
Peter Hutterer
8101e43774 touchpad: switch delta handling to typesafe coordinates
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-17 09:01:39 +10:00
Peter Hutterer
614dc10fd1 touchpad: switch touch point, hysteresis, initial coords to typesafe coords
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-17 09:01:39 +10:00
Peter Hutterer
dd3a2ea7d9 touchpad: change motion history to typesafe coords
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-17 09:01:39 +10:00
Peter Hutterer
d3fb0b1ea2 Merge branch 'master' into tablet-support 2015-03-10 11:28:57 +10:00
Peter Hutterer
7a54360ed3 Move DEFAULT_MOUSE_DPI to evdev.h, provide a conversion macro
Ideally we want to specify various thresholds in mm, but not all touchpads
set the hardware resolutions. Rather than conditions to check for resolutions
everywhere, use a macro to give us a normalized value that we use for motion
as well.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-10 07:09:23 +10:00
Peter Hutterer
3f7efc134e touchpad: return normalized deltas from tp_get_delta
All callers except the tap motion threshold call
tp_get_delta() followed by tp_filter_motion() - the latter normalized it
before calling into the accleration code.

Move the normalization into tp_get_delta() so we don't deal with
device-specific coordinates but normalized deltas instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-03-10 07:09:23 +10:00
Peter Hutterer
411f95b17f tablet: sync tools already in proximity at startup
If a tool is in proximity when we init, send a proximity event immediately.

This is only partially reliable due to the current kernel behavior:
* if the tool comes into proximity when there is no evdev client, the device
  won't send any events and must be lifted out-of-proximity first. Patch is in
  the works, see https://patchwork.kernel.org/patch/5924611/
* before 3.19, if the tool was in proximity (with an evdev client attached),
  but goes out of proximity and back in with no client connected, we get an
  immediate proximity out event from the kernel once we connect to the device
  and no further events after that.
  See kernel commit b905811a49bcd6e6726ce5bbb591f57aaddfd3be

Otherwise, things work as expected. The above should be fixed in the kernel
anyway.

Note that this changes the order of events during a udev seat init, before we
had all DEVICE_ADDED events in a row, now the proximity event may be
interspersed.

Reported-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-03-05 11:23:38 +10:00
Hans de Goede
ff02bd1b5b touchpad: Move gesture handling code to evdev-mt-touchpad-gestures.c
Just moving some code around, no functional changes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-23 10:01:02 +01:00
Hans de Goede
18887f90ee touchpad: Gesture support preparation
Handle everything which is not handled by the tap, (soft)button or edge-scroll
code/statemachines in a unified way. Everything is treated as a X-finger
gesture now, and the action to take on finger movement is decided by
the gesture.finger_count setting. Pointer control now simply is seen as a
1 finger gesture, and 2fg scrolling as a 2fg gesture.

This removed the need for special-casing things like switching back to
pointer mode when lifting a finger in 2fg scrolling mode, and also lays the
groundwork for adding 3+ fg gesture support.

Note that 1 test-case needs to be updated to wait for the finger mode
switching when switching mode while a gesture has already been started.
This is actually an improvement as this stops sending spurious pointer
motion events at the end of 2fg scrolling when not lifting both fingers at
exactly the same time.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-23 10:01:02 +01:00
Hans de Goede
6d03202730 touchpad: Add tp_get_average_touches_delta helper function
Add a tp_get_average_touches_delta helper function, and rename
tp_get_active_touches_delta to tp_get_combined_touches_delta to better
differentiate the two.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-23 09:50:09 +01:00
Hans de Goede
0cd92aeacd touchpad: Also stop edge scrolling when the trackpoint becomes active
Not only stop 2fg scrolling, but also edge scrolling when the trackpoint
becomes active.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-23 09:50:04 +01:00
Hans de Goede
f7bef28a54 touchpad: Change how we deal with scroll methods
With the upcoming gesture support 2fg scrolling will be handled as part of
the main gesture state machine, whereas edge scrolling has its own state
machine, our current way of dispatching scroll "actions" does not play well
with this.

Change the scroll method handling to treat edge and 2fg scrolling as 2
separate state machines. The double scroll calls this introduces will mostly
be removed when the gesture handling code lands.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-23 09:49:57 +01:00
Peter Hutterer
2840733978 cosmetic: drop more double empty lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-23 13:49:10 +10:00
Peter Hutterer
4ec2947cc9 test: add per-device udev rule support
Don't rely on a magic version tag, instead let a device define a udev rule and
drop that into the udev runtime directory before the device is created.

There are a couple of caveats with this approach: first, since this changes
system-wide state it may cause issues on the device the test suite is run on.
This can be avoided if the udev rules have filter patterns that ensure only
test devices are affected.

Second, the check test suite aborts but it doesn't run the teardown() function
if a test fails. So far this wasn't a problem since uinput devices disappear
whenever we exit. The rules files will hang around though, so an unchecked
fixture was added to delete all litest-foo.rules files before and after a test
case starts. Unchecked fixtures are run regardless of the exit status of the
test but run in the same address space - i.e. no ck_assert() usage.

Also unchecked fixtures are only run once per test-case, not once per test
function. For us, that means they're only run once per device (we use the
devices as test case), i.e. if a test fails and the udev rule isn't tidied up,
the next test may be unpredictable. This shouldn't matter too much though.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-02-03 10:34:26 +10:00
Peter Hutterer
149f711fcc test: add tests for new lenovo touchpads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-29 14:44:35 +10:00
Peter Hutterer
428614bb24 touchpad: re-route trackpoint buttons on the *50 Lenovo series
The laptops on this series have the physical trackpoint buttons back but
wired them up to the touchpad instead of the trackpoint device and they appear
as BTN_0, BTN_1 and BTN_2 for left, right, middle.

The udev hwdb marks these for us with the TOUCHPAD_HAS_TRACKPOINT_BUTTONS tag
[1]. Use that tag to identify them and re-route the events through the
trackstick device after mangling the event codes to represent the actual
buttons.

[1] http://cgit.freedesktop.org/systemd/systemd/tree/hwdb/70-touchpad.hwdb

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-29 14:43:57 +10:00
Peter Hutterer
0c50e186a0 touchpad: hook up click method configuration
Allow switching between softbuttons and clickfinger on any mt-capable
clickpad.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
[hdegoede@redhat.com] Keep top softbuttons working when enabling clickfinger
[hdegoede@redhat.com] Simply touchpad click method switching
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-01-16 10:34:24 +10:00
Hans de Goede
aee7ba8360 touchpad: Allow the center of pinned fingers to drift over time
Allow the center of pinned fingers to drift over time, to avoid accidentally
unpinning fingers.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86807
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-16 08:59:30 +10:00
Peter Hutterer
a467ac32cf touchpad: add a TOUCH_HOVERING state
Some touchpads provide touch information while the finger hovers over the
touchpad, i.e. before BTN_TOUCH. Add a touch state for those touchpads so we
can ignore the touches until they actually start.

The approach is now: instead of BEGIN we mark a new touch as HOVERING.
Use the BTN_TOOL_FINGER, BTN_TOOL_DOUBLETAP information during
tp_process_state() to mark any touches that are hovering as down or ended.

i.e. provided BTN_TOUCH is down: if BTN_TOOL_FINGER is down, one hovering
touch gets marked as down, if DOUBLETAP is down, two touches are marked as
down, etc.

When ending touches, switch them back into HOVERING if the BTN_TOOL_FINGER
is still set, otherwise end them properly.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-16 07:42:47 +10:00
Peter Hutterer
dc3d9315fe touchpad: use ffs instead of a manual count
BTN_TOOL_FINGER, DOUBLETAP, etc. are mutually exclusive in the kernel, so we
can use ffs here instead of manually counting.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-16 07:39:59 +10:00
Peter Hutterer
99cb908722 touchpad: factor out fake finger handling
We need this for determining hovering touches on some semi-mt touchpads.

This makes the fake_touches mask use bit 0 for BTN_TOUCH, and the other bits
for BTN_TOOL_FINGER, BTN_TOOL_DOUBLETAP, etc. BTN_TOUCH is independent of the
rest, the others are mutually exclusive in the kernel.

Since the mask isn't a straightforward bitmask anymore, abstract it all
through helper functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-16 07:39:59 +10:00
Stephen Chandler Paul
2af608cf02 Rename functions for left handed device configurations
Some devices require more than just flipping around the buttons, such as
tablets.
When it comes to devices like tablets, because the position of the palm rest is
on the right, the entire tablet has to be flipped around in order to be usable
by lefties. As such, this requires that we reverse the coordinates of the
tablets in addition to flipping the buttons on the tablet. As such, renaming
these functions so that they aren't specific to devices where only the buttons
are flipped seems appropriate.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-15 10:17:57 +10:00
Peter Hutterer
20ac4b3abd Add pointer axis sources to the API
For a caller to implement/provide kinetic scrolling ("inertial scrolling",
"fling scrolling"), it needs to know how the scrolling motion was implemented,
and what to expect in the future. Add this information to the pointer axis
event.

The three scroll sources we have are:
* wheels: scrolling is in discreet steps, you don't know when it ends, the
  wheel will just stop sending events
* fingers: scrolling is continuous coordinate space, we know when it stops and
  we can tell the caller
* continuous: scrolling is in continuous coordinate space but we may or may not
  know when it stops. if scroll lock is used, the device may never technically
  get out of scroll mode even if it doesn't send events at any given moment
  Use case: trackpoint/trackball scroll emulation on button press

The stop event is now codified in the API documentation, so callers can use
that for kinetic scrolling. libinput does not implement kinetic scrolling
itself.

Not covered by this patch:
* The wheel event is currently defined as "typical mouse wheel step", this is
  different to Qt where the step value is 1/8 of a degree. Some better
  definition here may help.
* It is unclear how an absolute device would map into relative motion if the
  device itself is not controlling absolute motion.
* For diagonal scrolling, the vertical/horizontal terminator events would come
  in separately. The caller would have to deal with that somehow.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Original patch, before the rebase onto today's master:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-12-24 10:47:00 +10:00
Peter Hutterer
6028e126fe touchpad: revert to pointer movement when stopping twofinger scrolling
Add a boolean state machine for two-finger scrolling so we know when we're
currently scrolling. If we were scrolling and it stops, pick the active
touch as pointer touch so we can go back to pointer movement without having to
lift the finger off the touchpad.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 11:14:39 +10:00
Hans de Goede
d21c8886c4 touchpad: Use TOUCHPAD_MIN_SAMPLES in tp_get_delta
Use TOUCHPAD_MIN_SAMPLES in tp_get_delta rather then hardcoding "4".

Also remove the superfluous TOUCHPAD_MIN_SAMPLES check before calling
tp_get_delta in tp_get_pointer_delta, this is not necessary as tp_get_delta
already checks itself.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-17 16:20:20 +10:00
Hans de Goede
6664144611 touchpad: When a clickpad is clicked post combined motion of all touches
When clicking a clickpad the user may want to switch fingers to move the
pointer around, without lifting so as to not release the button.

Switch to using combined motion of all touches when a clickpad is clicked to
allow this.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86807
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-17 16:20:15 +10:00
Hans de Goede
759e5eca6d touchpad: Add a tp_post_pointer_motion helper function
Split out the pointer-motion handling into a helper function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-17 16:20:09 +10:00
Hans de Goede
36017fbd3c touchpad: Use remove callback to unlink event listener and stop timers
We use 2 mechanisms to unregister the trackpoint event listener depending on
device removal order.

1) We have a device_removed callback, if the trackpoint gets removed before
the touchpad, this gets called, sees the device being removed is the trackpoint
and unregisters the listener

2) If the touchpad gets removed first, then in tp_destroy we unregister the
listener

2) May be delayed beyond the destruction of the trackpoint itself if the
libinput user has a reference to the libinput_device for the touchpad.
When this happens the trackpoint still has an eventlistener at destroy time
and an assert triggers.

To fix this we must do 2) at the same time as we do 1), so at remove time.

While working on this I noticed that the touchpad code was also cancelling
timers at destroy time rather then remove time, which means that they may
expire between remove and destroy time, and cause events to be emitted from
a removed device, so this commit moves the cancelling of the timers to the
remove callback as well.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-09 09:55:36 +01:00
Hans de Goede
4a971a69cf evdev: Add a remove callback to the evdev_dispatch_interface
Some dispatchers may want to do some cleanup at remove time, rather then at
destroy time.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-09 09:55:36 +01:00
Jonas Ådahl
93eca929ae Introduce unaccelerated motion event vectors
For certain applications (such as FPS games) it is necessary to use
unaccelerated motion events (the motion vector that is passed to the
acceleration filter) to get a more natural feeling. Supply this
information by passing both accelerated and unaccelerated motion
vectors to the existing motion event.

Note that the unaccelerated motion event is not equivalent to 'raw'
events as read from devices.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-05 11:54:02 +10:00
Peter Hutterer
06720852fc touchpad: drop unused device arg from tp_clear_state
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-04 15:58:33 +10:00
Peter Hutterer
3c7e3a1973 Change default DPI to 1000
400 used to be the default DPI for many mice but it it's not anymore. A survey
of mice shows that 400 is still common as one of the pre-configured settings
in switchable multi-resolution gaming mice, but devices with a single
resolution mostly favor 1000 dpi.

Let's make that switch now so that any future changes to the pointer
acceleration code assumes that resolution as a default.

For the touchpad, this has a bad side-effect, caused by our expectation of
mouse vs touchpad behaviours: our acceleration code ignores device type and
provides the same acceleration for the same physical movement. Unfortunately,
we expect touchpads to be significantly slower than mice.

The previous 400 DPI worked because it caused an acceptable slowdown on input.
e.g. on the T440 with a res of 42 units/mm, the scale coefficient was 0.37.
For 1000 DPI as default, this now results in 0.94, i.e. speeding up the
touchpad by a factor of 2.5. That is way too fast.

Adding touchpad-specific filter code is a bigger project, so let's just add a
fixme for now and scale the coefficient back to what it was before the
DPI default change. Effect: touchpad behaves as before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-12-02 10:16:31 +10:00
Peter Hutterer
7e3cc15819 Move DEFAULT_MOUSE_DPI to filter.h
The filter code is what relies on some default dpi configuration to apply
pointer acceleration and expects the input coordinates to be pre-scaled to
that resolution.

Let's move the define here so we can use it from the touchpad code too.

No functional changes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-12-02 10:16:31 +10:00
Hans de Goede
6a4ceed2b9 touchpad: Add edge-scrolling support
Add edge-scrolling support for non multi-touch touchpads as well as for
users who prefer edge-scrolling (as long as they don't have a clickpad).

Note the percentage to use of the width / height as scroll-edge differs from
one manufacturer to the next, the various per model percentages were taken
from xf86-input-synaptics.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=85635
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-25 17:02:30 +10:00
Hans de Goede
8b6572bfae touchpad: Add code to get the touchpad model / manufacturer
This is useful to know in some cases, it is e.g. necessary to figure out
which percentage of a touchpads range to use as edge for edge-scrolling.

Note this is a slightly cleaned up copy of the same code in
xf86-input-synaptics.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-25 17:02:27 +10:00
Hans de Goede
26080263e6 touchpad: Move 2 finger scrolling functions to above tp_process_state()
This is purely a code move, this is a preparation patch for adding edge
scrolling support.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-25 17:02:25 +10:00