From bae2e0ecf254b990d3d720beb056baef59bb9f16 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 16 Sep 2019 15:39:31 +0200 Subject: [PATCH] ui/app: (wayland) restore discrete scrolling behaviour Signed-off-by: Elias Naur --- ui/app/os_wayland.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go index 2f0001a1..47d5ba3c 100644 --- a/ui/app/os_wayland.go +++ b/ui/app/os_wayland.go @@ -1001,10 +1001,6 @@ func (w *window) flushScroll() { dist := float32(w.flinger.Tick(time.Now())) fling = w.flingDir.Mul(dist) } - total := w.scroll.Add(fling) - if total == (f32.Point{}) { - return - } // The Wayland reported scroll distance for // discrete scroll axis is only 10 pixels, where // 100 seems more appropriate. @@ -1015,6 +1011,10 @@ func (w *window) flushScroll() { if w.discScroll.Y != 0 { w.scroll.Y *= discreteScale } + total := w.scroll.Add(fling) + if total == (f32.Point{}) { + return + } w.w.event(pointer.Event{ Type: pointer.Move, Source: pointer.Mouse,