[synaptics] Fix inverted circular scrolling direction

Submitted by Peter Hutterer on March 14, 2012, 3:27 a.m.

Details

Message ID 20120314032729.GA16614@yabbi.bne.redhat.com
State Accepted
Headers show

Not browsing as part of any series.

Commit Message

Peter Hutterer March 14, 2012, 3:27 a.m.
Introduced in 26831a6eeac6762ad4d99532f62ebbab0827de10.
In said commit, the old-style button events were changed to delta
accumulation. Alas, for circular scrolling, a positive delta is up whereas
for everything else a positive delta is down.

Reported-by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 src/synaptics.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/synaptics.c b/src/synaptics.c
index fa46f0d..c9609cd 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2554,9 +2554,9 @@  HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 	double diff = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y));
 	if (delta >= 0.005 && diff != 0.0) {
 	    if (priv->circ_scroll_vert)
-		priv->scroll.delta_y += diff / delta * para->scroll_dist_vert;
+		priv->scroll.delta_y -= diff / delta * para->scroll_dist_vert;
 	    else
-		priv->scroll.delta_x += diff / delta * para->scroll_dist_horiz;;
+		priv->scroll.delta_x -= diff / delta * para->scroll_dist_horiz;;
 	    priv->scroll.last_a = angle(priv, hw->x, hw->y);
 	    DBG(priv, 10, "circ scoll delta: %.2f diff %.2f angle %.2f\n", delta, diff, priv->scroll.last_a);
         }

Comments

On 03/13/2012 08:27 PM, Peter Hutterer wrote:
> Introduced in 26831a6eeac6762ad4d99532f62ebbab0827de10.
> In said commit, the old-style button events were changed to delta
> accumulation. Alas, for circular scrolling, a positive delta is up whereas
> for everything else a positive delta is down.
> 
> Reported-by: Thomas Bächler <thomas@archlinux.org>
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> ---
>  src/synaptics.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/synaptics.c b/src/synaptics.c
> index fa46f0d..c9609cd 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -2554,9 +2554,9 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
>  	double diff = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y));
>  	if (delta >= 0.005 && diff != 0.0) {
>  	    if (priv->circ_scroll_vert)
> -		priv->scroll.delta_y += diff / delta * para->scroll_dist_vert;
> +		priv->scroll.delta_y -= diff / delta * para->scroll_dist_vert;
>  	    else
> -		priv->scroll.delta_x += diff / delta * para->scroll_dist_horiz;;
> +		priv->scroll.delta_x -= diff / delta * para->scroll_dist_horiz;;
>  	    priv->scroll.last_a = angle(priv, hw->x, hw->y);
>  	    DBG(priv, 10, "circ scoll delta: %.2f diff %.2f angle %.2f\n", delta, diff, priv->scroll.last_a);
>          }

Looks fine to me, though I'd suggest cleaning up the double semi-colon.

Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
On Fri, Mar 16, 2012 at 04:56:42PM -0700, Chase Douglas wrote:
> On 03/13/2012 08:27 PM, Peter Hutterer wrote:
> > Introduced in 26831a6eeac6762ad4d99532f62ebbab0827de10.
> > In said commit, the old-style button events were changed to delta
> > accumulation. Alas, for circular scrolling, a positive delta is up whereas
> > for everything else a positive delta is down.
> > 
> > Reported-by: Thomas Bächler <thomas@archlinux.org>
> > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> > ---
> >  src/synaptics.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/synaptics.c b/src/synaptics.c
> > index fa46f0d..c9609cd 100644
> > --- a/src/synaptics.c
> > +++ b/src/synaptics.c
> > @@ -2554,9 +2554,9 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
> >  	double diff = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y));
> >  	if (delta >= 0.005 && diff != 0.0) {
> >  	    if (priv->circ_scroll_vert)
> > -		priv->scroll.delta_y += diff / delta * para->scroll_dist_vert;
> > +		priv->scroll.delta_y -= diff / delta * para->scroll_dist_vert;
> >  	    else
> > -		priv->scroll.delta_x += diff / delta * para->scroll_dist_horiz;;
> > +		priv->scroll.delta_x -= diff / delta * para->scroll_dist_horiz;;
> >  	    priv->scroll.last_a = angle(priv, hw->x, hw->y);
> >  	    DBG(priv, 10, "circ scoll delta: %.2f diff %.2f angle %.2f\n", delta, diff, priv->scroll.last_a);
> >          }
> 
> Looks fine to me, though I'd suggest cleaning up the double semi-colon.

done, thanks.
 
> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

Cheers,
  Peter