Disable driver scaling for input ABI 19.2

For absolute devices in relative mode, i.e. touchpads, the server now takes
device resolution into account. Doing so means that the driver mustn't
scale, so we deactivate those bits in the driver.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Switch to libevdev for the eventcomm backend

This has a potential bug that would need to be fixed in mtdev first:
if we get a SYN_DROPPED and we miss out on events, the current code emulates a
normal EV_SYN, feeds that to mtdev and hopes that that fills the mtdev output
queue.

If mtdev doesn't generate events on that EV_SYN, we're stuck in limbo and may
get weird results. The loop will continue and sync the device, but there's the
off chance we get odd events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Drop maintainer mode

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
autogen.sh: support NOCONFIGURE=1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Drop edge speed from get_delta

Always 0 anyway, and the feature was purged in
xf86-input-synaptics-1.6.0-8-g54f65f3

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eventcomm: ungrab the device on DeviceOff

For symmetry, the kernel should ungrab when we close the fd.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add missing property handler for the pressure motion factor

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fix ABI detection for in-driver scaling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
On clickpads with two touchpoints, try to detect clickfinger 3 actions

Some touchpads provide BTN_TOOL_TRIPLETAP but do not track more than two
touchpoints. For those, try to detect clickfinger3 actions as best as we can.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9388b54a109bbd634e05611e6c90110d698f13d1)
Bump to 1.7.99

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Revert "Purge scrollbuttons (repeat)"

This reverts commit 0903d99ada1755f11a2a5cbf89a345de896e18ec.

Scroll buttons are still present in some modern devices, e.g. the Fujitsu
Lifebook E782 and others in the series.

Conflicts:
	include/synaptics.h
	man/synaptics.man
	src/synaptics.c
Drop the half-baked test suite

This suite was never really maintained anyway, and it is quite hard to do so
anyway. The driver is linked to the server's API too tightly to easily do
independent testing. We need to re-implement stubs for the API the driver
uses, have to track API changes, etc. Not worth the effort.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Revert "Drop circular pad support"

This reverts commit 3b02e7fd81da4b100fb9ac32378f6d50f54cf0e2.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Conflicts:
	man/synaptics.man
	src/synaptics.c

Acked-by: Daniel Stone <daniel@fooishbar.org>
man: setting scroll deltas to 0 doesn't work (#75074)

6d47d33 disallows a zero value for horizontal/vertical scroll deltas but the
man page wasn't updated. We've added separate toggles to enable/disable
scrolling a few years ago, setting the distance to 0 is not recommended.

X.Org Bug 75074 <http://bugs.freedesktop.org/show_bug.cgi?id=75074>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Allow using the entire touchpad for motions started inside the active area

synaptics offers an option to make parts of the touchpad insensitive. This
is ie useful to do palm avoidance rather then palm detection (which may be
unreliable) by disabling an area of 15% on the right and left side of the
touchpad.

Currently a motion which has started inside the active area, stops as soon
as it moves outside of the active area.

If a motion started inside the active area and thus has already generated some
move events, this makes no sense. If the user moves outside of the active
area in this case, this is very likely because the user wants to continue
the motion.

This commit allows such motions to continue normally.

I would like to thank Juerd Waalboer for the basic idea, some coding and lots
of testing for this fix.

Cc: Juerd Waalboer <juerd@tnx.nl>
Reported-by: Juerd Waalboer <juerd@tnx.nl>
Tested-by: Juerd Waalboer <juerd@tnx.nl>
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>
Add secondary (top) software buttons area

New generation of laptops with trackstick do not have physical buttons
associated with the trackstick, but instead rely on software buttons at
the top of the clickpad.
Adding a secondary software button area for this purpose.
As we're likely detecting the devices that need it based on udev tags
and MatchTag configuration items, this area doesn't need to be exposed
through properties. So static configuration is fine.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

[couple of man-page additions and rewrites]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Close device if DeviceOnHook fails

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
When re-opening evdev, set the fd before trying to grab

If we try to grab the evdev device before we've set the new file
descriptor, libevdev_grab returns -EFAULT, which causes DeviceOn to
fail.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add another third state to TouchpadOff for disabling all but button clicks

On a new set of laptops like the Lenovo T440 the trackstick does not have
physical buttons. Instead, the touchpad's top edge is supposed to acts
software button area. To avoid spurious cursor jumps when the trackstick is in
use and the finger is resting on the touchpad, add another mode that disables
motion events.

Enabled by syndaemon with -t click-only, the default stays unchanged. No
specific integration with the traditional disable-while-typing is needed. On
such touchpads, disabling motion events is sufficient to avoid spurious
events and we don't want to stop HW buttons to send events.

Note that this only adds the new state to the driver and to syndaemon, there
is nothing hooked up otherwise to actually monitor the trackstick.

Special note for syndaemon: optional arguments are a GNU extension, so work
around it by messing with an optstring starting with ":" which allows us to
manually parse the options.

Original version of this patch by John Pham <jhnphm@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add an enum for the different soft_button_areas

While at it also move the enum for the soft button edges out of
is_inside_button_area() so that it can be used elsewhere too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>