From aa985514a6b29d405209ae97cf54958997d821c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 24 Jul 2022 22:47:38 +0200 Subject: [PATCH] sdgui: fix up the smooth scrolling commit --- src/stardict-view.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stardict-view.c b/src/stardict-view.c index a6f7733..2ac02e0 100644 --- a/src/stardict-view.c +++ b/src/stardict-view.c @@ -489,8 +489,9 @@ stardict_view_scroll_event (GtkWidget *widget, GdkEventScroll *event) { // On GDK/Wayland, the mouse wheel will typically create 1.5 deltas, // after dividing a 15 degree click angle from libinput by 10. + // (Noticed on Arch + Sway, cannot reproduce on Ubuntu 22.04.) // On X11, as libinput(4) indicates, the delta will always be 1.0. - double delta = CLAMP(event->delta_y, -1, +1); + double delta = CLAMP (event->delta_y, -1, +1); stardict_view_scroll (self, GTK_SCROLL_STEPS, 3 * delta); return TRUE; }