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>
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>
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>
Replace numerical values with an enum for the TouchpadOff prop

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
eventcomm: print axis resolution to the log

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools: drop -s listing in synclient's help output. SHM is gone.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
synclient: remove 'm' and 'h' from getopt and man page

Removed as of 83d88b253139f9c92d619e7ad7c3981138893536

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
synclient: support -? for usage

man page and help claim we support this, so let's do so

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
syndaemon: list -? in help/man page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
synclient: drop XF86Config-4 from man page

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
synclient: use a parameter that actually exists in the man page example

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Improve readability of the soft button areas

Replace the hardcoded indices with enums that are somewhat expressive.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
man: clarify that 0, not 0% disables the softbutton area

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Allow soft button areas to overlap on the edge

For percent-based configuration in the form of
middle button 33%-66%, right button 66%-0 we'd get an error because of the
one device unit overlap. This was neither documented nor useful, because
leaving a 1% gap leaves an actual gap between the buttons. Allow for an
overlap of one device unit on the edge of the buttons.

What's picked in that case depends on the implementation of
is_inside_softbutton_area but since one device unit is so small, it doesn't
matter.

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>
Plug memory leak for option_string

xf86SetStrOption() returns a strdup'd string that must be freed after use.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Plug memory leak for priv->touch_axes

Allocated in event_query_touch, was never freed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
synaptics 1.7.1

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