From a6e344337d4db35974ff4386d4868b5acc55d0b2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 1 Mar 2012 16:27:01 +1000 Subject: [PATCH] Fix scoll increment for non-smooth scrolling (#46617) Introduced in 2603ad69b997c999404ecc441e0d64ea2cc22018. Previously, the delta was incremented by (actual delta/scroll dist), button clicks where then sent while (delta-- >= 1). After 2603ad69b997c999404ecc441e0d64ea2cc22018, the delta was incremented by the delta only, scroll dist was used as increment in the smooth scrolling information. On non-smooth-scrolling servers, the driver would now send too many events. Restore the old behaviour by dividing by the scroll distance before entering the button click loop. X.Org Bug 46617 --- src/synaptics.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/synaptics.c b/src/synaptics.c index 139f237..7713784 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2743,6 +2743,12 @@ post_scroll_events(const InputInfoPtr pInfo) if (valuator_mask_num_valuators(priv->scroll_events_mask)) xf86PostMotionEventM(pInfo->dev, FALSE, priv->scroll_events_mask); #else + SynapticsParameters *para = &priv->synpara; + + /* smooth scrolling uses the dist as increment */ + priv->scroll.delta_y /= para->scroll_dist_vert; + priv->scroll.delta_x /= para->scroll_dist_horiz; + while (priv->scroll.delta_y <= -1.0) { post_button_click(pInfo, 4); -- 1.7.7.6