Add header inclusion guards to touchpad-util.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
config: add option to change the motion history size

Still has a max though, we can't allocate during touch creation so this can't
be a dynamic value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
config: return an error for bad configurations

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
config: add TOUCHPAD_CONFIG_LAST for easier loops

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xorg: drop timer offset now that we're on CLOCK_MONOTONIC

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Drop the separate timer expiry function

Pass the current time into touchpad_handle_events() instead and let
libtouchpad figure out the rest. Previously we didn't handle any events off
the wire when handling time expiry but that leads to race conditions: if
events are sitting on the wire that happened before the timer expiry but we
the backend didn't call earlier, we might handle an expiry when we really
should be handling the events.

This patch doesn't fix this yet, it merely enables the fix for it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tap: improve single-finger tap-n-drag

If the finger is released during tap-and-drag, set a timeout. If the finger
goes down within that timeout, continue dragging. Otherwise, on timeout,
release.

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