libevdev sync without tracking ID

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 17 20:07:01 PDT 2014


I just spotted something interesting, related to the recent changes with
SYN_DROPPED handling.

We now handle ABS_MT_TRACKING_ID for devices with a slot, terminating and
re-creating touchpoints if the tracking ID changes during SYN_DROPPED. One 
thing I did notice is that we update the axes even if the tracking ID is -1.
This can easily be triggered with the libevdev-events tool we ship:

1. start libevdev-events on a touchpad
2. one finger on the touchpad, move, lift finger off
3. pause libevdev-events
4. one finger on the touchpad, move, lift finger off again
5. resume libevdev-events

libevev-events gets a SYN_DROPPED, the tracking ID is -1 before and -1
after, we simply missed the whole touchpoint. The other axes may have
changed though, so in the sync process we send events for each MT axis that
did so, in each slot.
The event sequence would thus be something like:

ABS_MT_SLOT 0
ABS_MT_TRACKING_ID 3
ABS_MT_POSITION_X 50
ABS_MT_POSITION_X 50
SYN_REPORT
ABS_MT_TRACKING_ID -1 
SYN_REPORT
SYN_DROPPED
ABS_MT_POSITION_X 100
SYN_REPORT

Now, the question is: should we discard these events in libevdev or just
tell the clients that they need to expect this to happen?
afaict if we don't pass on the changed axes we may miss out on events in the
future, the kernel wouldn't give us the axis on the next touchpoint if the
value is the same. This is unlikely, but still possible.

Cheers,
   Peter


More information about the Input-tools mailing list