tablet: add touch arbitration
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 28 Jun 2016 01:28:34 +0000 (11:28 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 7 Sep 2016 01:17:03 +0000 (11:17 +1000)
commitb519ea4ab52e76af585e800fd766bb188114a0b3
tree63dadb0906c1b682a03fbca5ce4d424ad961f3d0
parent1ce99fd69858bca72e78689ef28a57a66672d802
tablet: add touch arbitration

So far we've relied on the wacom kernel module to do touch arbitration for us
but that won't be the case in upcoming kernels. Implement touch arbitration in
userspace by pairing the two devices and suspending the touch device whenever
a tool comes into proximity.

In the future more sophisticated arbitration can be done (e.g. only touches
which are close to the pen) but let's burn that bridge when we have to cross
it.

Note that touch arbitration is "device suspend light", i.e. we leave the
device enabled and the fd is active. Tablet interactions are comparatively
short-lived, so closing the fd and asking logind for a new one every time the
pen changes proximity is suboptimal. Instead, we just keep a boolean around
and discard all events while it is set.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
doc/tablet-support.dox
src/evdev-mt-touchpad.c
src/evdev-mt-touchpad.h
src/evdev-tablet-pad.c
src/evdev-tablet.c
src/evdev-tablet.h
src/evdev.c
src/evdev.h
test/tablet.c