Skip to content
  • Carlos Garnacho's avatar
    x11: Query pointer devices' scroll valuators on toplevel enter events · 77b8495b
    Carlos Garnacho authored
    We used to "invalidate" scroll valuators, so the next scroll event could
    be used as the base for the next scroll deltas. This has the inconvenience
    that it invariably consumes the first event received after enter and,
    due to interactions with WM overeager passive button grabs, there's a
    possibility we don't scroll at all if we receive interleaved "smooth
    scroll" XI_Motion events and XI_Enter events (Normally triggered by regular
    scroll wheels in mice).
    
    In order to fix this, and at the expense of some sync-call overhead on
    XI_Enter events (one XIQueryDevice call per slave device), query the
    current scroll valuator state for all the slaves of the entered pointer,
    so we do know beforehand the right base values. If new devices are plugged
    while the pointer is on top of the client, the initialized scroll values
    will match the valuators'.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750994
    https://bugzilla.gnome.org/show_bug.cgi?id=750870
    77b8495b