Allow dead areas to update the button state

On clickpads, a dead area helps prevent pointer movement when the buttons
are pressed. Thus check for the button state before resetting the hw state
in case we get a right-click in the soft button area.

For clickfinger, the effect is that clickfinger events are now triggered if
the finger rests in the dead area.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a5ac54f60af96b9b862425ccd8b6c7afaa4937e4)

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

Conflicts:
	src/synaptics.c
test: drop xf86CheckStrOption from fake symbols

The tests don't need this symbol anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 3cb14dcccf5574366d90e24f351e3ad04b35e35f)

Conflicts:
	test/fake-symbols.c
	test/fake-symbols.h
Use LogMessageVerbSigSafe on ABI 18

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
(cherry picked from commit e28575b29b394b38f1d92b75353fc0fe82838b7c)
Free mtdev device as well as closing it

mtdev_close_delete() is to mtdev_new_open() as mtdev_close() is to
mtdev_open().  So, since we're using mtdev_new_open(), we need to use
mtdev_close_delete() instead of just mtdev_close() to actually free
everything.

Fixes an eventual failure to open the touchpad device after a lot of
suspend/resume cycles.

[whot: amended to mtdev_close_delete in evdev_query_touch]

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ce7565ea6683f594f1f2ab5769bf60b1337d70bd)
Recognise the soft button area property before clickpad is enabled

Otherwise the driver has no internal reference to the soft button area
property and will ignore any setting.

Also, if a client sets this property, we claim it as our own and disallow
deletion.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 86460318ba5606ef41712b52e50bf7b2ba083226)
synaptics 1.6.2.901

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
conf: add example for AreaBottomEdge on clickpad buttons

Those that use clickpad buttons as buttons can see cursor jumps as the press
on the touchpad - largely caused by the finger changing shape as the
pressure changes and thus moving the hotspot.

Simple fix is to define the clickpad soft button areas as dead areas, but
this cannot be set as general option as it would break for those that use
tapping.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 2159b5d26207c83efea6efca7fa5765df95a4219)
synaptics 1.6.3

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fix stack smash in clickpad_guess_clickfingers()

Apple Magic Trackpad can report 16 slots. In clickpad_guess_clickfingers()
the array allocated on the stack contains only 10 slots.
As (.num_mt_mask == .num_slots), the function writes out of the bounds
of close_point.

Use a size 32 bitmask instead and warn if we ever get past 32 touchpoints.

This fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=952221

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

Conflicts:
	src/synaptics.c
synaptics 1.6.4

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add the embedded LED support

This patch adds the control of the embedded LED on the top-left corner
of new Synaptics devices.  For LED control, it requires the patch to
Linux synaptics input driver,
	https://patchwork.kernel.org/patch/92434/

When a sysfs file /sys/class/leds/psmouse::synaptics exists, the driver
assumes it supports the embeded LED control.

The LED can be controlled via new properties, "Synaptics LED" and
"Synaptics LED Status".

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add tap-on-LED feature support

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add LED debugging statements