From d06e26356b625a19be32eef03def59e99afffffa Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 27 Nov 2018 19:54:26 +0100 Subject: [PATCH] Fix scrolling in wrong direction when using mouse wheel in filebrowser, #5036 --- rtgui/thumbbrowserbase.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc index fdb551f45..5f75967e6 100644 --- a/rtgui/thumbbrowserbase.cc +++ b/rtgui/thumbbrowserbase.cc @@ -76,6 +76,10 @@ void ThumbBrowserBase::scroll (int direction, double deltaX, double deltaY) } else { delta = deltaY; } + if (direction == GDK_SCROLL_SMOOTH && delta == 0.0) { + // sometimes this case happens. To avoid scrolling the wrong direction in this case, we just do nothing + return; + } double coef = direction == GDK_SCROLL_DOWN || (direction == GDK_SCROLL_SMOOTH && delta > 0.0) ? +1.0 : -1.0; // GUI already acquired when here