talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit f3e0150378312900ca1b05b3c94fdcd22fdfcacc
parent cf0d5714de9a48b76ad989e49d96fd8904f7db2c
Author: wwp <subscript@free.fr>
Date:   Wed, 15 Sep 2021 11:28:38 +0200

Fix scrolling in a message's attachments bar (scrolling left or right
were scrolling down).
Also fix scrolling not working when GTK smooth scroll is set.

Diffstat:
Msrc/mimeview.c | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/mimeview.c b/src/mimeview.c @@ -1543,8 +1543,20 @@ static gboolean mimeview_scrolled(GtkWidget *widget, GdkEventScroll *event, GtkVScrollbutton *scrollbutton = (GtkVScrollbutton *)mimeview->scrollbutton; if (event->direction == GDK_SCROLL_UP) { scrollbutton->scroll_type = GTK_SCROLL_STEP_BACKWARD; - } else { + } else if (event->direction == GDK_SCROLL_DOWN) { scrollbutton->scroll_type = GTK_SCROLL_STEP_FORWARD; + } else { + gdouble x, y; + + if ((event->direction == GDK_SCROLL_SMOOTH) && + gdk_event_get_scroll_deltas(event, &x, &y)) { + if (y < 0) + scrollbutton->scroll_type = GTK_SCROLL_STEP_BACKWARD; + else + if (y >0) + scrollbutton->scroll_type = GTK_SCROLL_STEP_FORWARD; + } else + return FALSE; /* Scrolling left or right */ } gtk_vscrollbutton_scroll(scrollbutton); return TRUE;