Skip to content

Always push changed mt events when syncing

Peter Hutterer requested to merge whot/libevdev:wip/force-sync-tool-type into master

This replaces !122 (closed), cc @andeston, it fixes the test case by avoiding duplicate tracking ids of -1 and adds a new test case for the issue this patch fixes

If the start and end of a touch are dropped, the slot, according to the kernel, may have a different state. We should inform the client of these changes even if the slot is not currently active.

For most axes this doesn't matter too much as we expect them to change during an active touch anyway so we don't expect the kernel's caching to be a problem. However where the ABS_MT_TOOL_TYPE changed during a sync we need to inform the client of the new tool type so that future touchese won't be erroneously treated as e.g. palms.

For a full reproducer see the test case but it comes down to:

  • touch down with MT_TOOL_PALM, make sure libevdev reads the state
  • change that slot to MT_TOOL_FINGER, trigger a sync
  • ensure that libevdev pushes out that tool type change even if the slot is not currently active

Merge request reports

Loading