Reset num_active_touches on DeviceOff (#52496)

When disabling the device, reset num_active_touches to zero. Otherwise,
num_active_touches stays at the value it was on DeviceOff(). Future touches
add to that value until the index may go past priv->open_slots[].
That causes spurious memory corruption on touch ends.

And as of 55fc42e7c9b4948cadd4f98ef7b6a3b12e268e3e we ignore pre-existing
touches anyway.

Test-case:
- place num_touches fingers on the touchpad
- xinput disable <device>
- lift fingers
- xinput enable <device>
- place finger on device, num_active_touches is now (num_touches + 1)

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
(cherry picked from commit a245d42f53096b1ae81e6702729f97ca508e5b5b)

Conflicts:
	src/synaptics.c
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>
First patch version
Patch version 2
Patch version 3
RMB-tap patch
RMB-tap patch v2
RMP-patch v3
Dualhead resolution fix