Skip to content
  • Peter Hutterer's avatar
    Terminate all stopped/changed touches during SYN_DROPPED in the first frame · 41de1b0e
    Peter Hutterer authored
    The previous event processing had subtle issues with touches stopping during
    SYN_DROPPED. All of the device state was processed in the same frame, but if
    any touch changed tracking ID during SYN_DROPPED, an inserted SYN_REPORT
    resulted in a weird split of events:
    - the first frame had all key/sw/abs updates including those slots that
      changed tracking ID, but not the ones that were fully terminated.
    - the second frame had only the slots states for newly started touches **and**
      the slot state for touches terminated during SYN_DROPPED but not restarted.
    
    In other words, where three fingers were on the touchpad and slot 0 was lifted
    and put down again and slot 1 was lifted but *not* put down again, our frames
    contained:
    - frame 1: terminate slot 0, BTN_TOOL_TRIPLETAP 0, BTN_TOOL_DOUBLETAP 1
    - frame 2: start slot 0, terminate slot 1
    
    Where there was no touch changing tracking ID, only one frame was generated.
    The BTN_TOOL updates were buggy, they may not match the number of fingers down
    as seen on a frame-by-frame basis. This triggered libinput bug
    libinput/libinput#422
    
    
    
    This patch changes the above example to
    - frame 1: terminate slot 0, terminate slot 1
    - frame 2: start slot 0, BTN_TOOL_TRIPLETAP 0, BTN_TOOL_DOUBLETAP 1
    
    Notably, the first frame no longer contains the BTN_TOOL bits. This patch is
    one of two, the BTN_TOOL sync bits are part of a follow-up patch.
    
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    41de1b0e