Skip to content
  • Peter Hutterer's avatar
    filter: normalize deltas before processing or returning them · 5f0d310e
    Peter Hutterer authored
    When the filter code switched to raw device coordinates (bdd4264d) the input
    data remained in device coordinates. Since the factor for touchpads was still
    based on the physical velocity (and thus all touchpads get the same
    acceleration factor for identical moves), the actual delta was dependent on
    the resolution. e.g.
    
    touchpad with 40u/mm: delta of 2/2 * accel factor 2 -> accel delta of 4/4
    touchpad with 20u/mm: delta of 1/1 * accel factor 2 -> accel delta of 2/2
    
    The normalized coordinates should be independent of the touchpad's resolution
    though.
    
    Affected by this was the standard mouse accel code and the touchpad accel
    code, other filters always returned unnormalized coordinates (separate bug,
    not addressed here).
    
    This patch restores the correct behaviour for mice and touchpads
    while leaving the special filters untouched. For comparision:
    * 1000+dpi mice: accelerate normalized, return normalized
    * touchpads: accelerate unnormalized, return normalized
    * low-dpi mice: accelerate unnormalized, return unnormalized
    * trackpoints: accelerate unnormalized, return unnormalized
    * x230: don't touch, already does the right thing
    
    https://bugs.freedesktop.org/show_bug.cgi?id=99383
    
    
    
    Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
    5f0d310e