Update the BTN_TOOL bits correctly during SYN_DROPPED handling
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 13 Feb 2020 11:35:51 +0000 (21:35 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 19 Feb 2020 01:09:31 +0000 (11:09 +1000)
commitd6c2b3d0de25f7442ec8629350a8d0b3f1bfaf50
treeb627dc74895ed44584ed4168d6b4ef74a43618d2
parent41de1b0e1ade95dec46c10500db759e16e35a981
Update the BTN_TOOL bits correctly during SYN_DROPPED handling

Where at least one touch ends during SYN_DROPPED, we send out two event
frames: one with all applicable touch sequences ending (tracking id -1) and
the second one with the whole device state *and* the applicable touch
sequences starting (tracking id != -1).

This requires us to also update the BTN_TOOL_ bits correctly so that they are
correct after the first frame. For that we count the number of previously
known touches and send a 0 event for the matching BTN_TOOL_ bit, together with
a 1 event for the currently known touches.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libevdev/libevdev.c
test/test-libevdev-events.c