From c8e4bd2b5851ebd0b31e3ddf99fd0a4a1f449c22 Mon Sep 17 00:00:00 2001 From: Nicolas Peugnet Date: Tue, 9 Apr 2024 21:08:45 +0200 Subject: [PATCH] Fix scroll regression introduced in 562ac8ffe Simply checking that the Buttons bitset of both events is the same is not enough to set the motion to true. We have to make ture that the event is only for buttons and not for the mouseweel. --- application.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application.go b/application.go index b7edf10..5b01641 100644 --- a/application.go +++ b/application.go @@ -134,7 +134,8 @@ func (app *Application) Start() error { redraw = app.root.OnPasteEvent(customEvt) } case *tcell.EventMouse: - hasMotion := app.prevMouseEvt.Buttons() == event.Buttons() + onlyButtons := event.Buttons() < tcell.WheelUp + hasMotion := onlyButtons && app.prevMouseEvt.Buttons() == event.Buttons() customEvt := customMouseEvent{event, hasMotion} app.prevMouseEvt = event redraw = app.root.OnMouseEvent(customEvt)