Skip to content
  • Peter Hutterer's avatar
    Calculate the required scroll distance based on the angle · 0dad7408
    Peter Hutterer authored
    For a mouse with a click angle of 15 degrees things are unchanged. For devices
    with angles less than 10, the current code scrolled way too fast. Because the
    angle wasn't used anywhere, each tick would count as full scroll wheel event,
    a slight movement of the wheel would thus scroll as much as a large movement
    on a normal mouse.
    
    Fix this by taking the actual click angle of the device into account. We
    calculate some multiple of the angle that's close enough to the default 15
    degrees of the wheel and then require that many click events to hit the full
    scroll distance. For example, a mouse with a click angle of 3 degrees now
    requires 5 clicks to trigger a full legacy scroll button event.
    
    XI2.1 clients get the intermediate events (i.e. in this case five times
    one-fifth of the scroll distance) and can thus scroll smoothly, or more
    specifically in smaller events than usual.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=92772
    
    
    
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
    0dad7408