[evince/866-touchpad-scrolling-should-only-scroll-on-one-axis-at-a-time] ev-view.c: do scroll only on one axis at a time. Issue #866
- From: Nelson Benítez León <nbenitez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/866-touchpad-scrolling-should-only-scroll-on-one-axis-at-a-time] ev-view.c: do scroll only on one axis at a time. Issue #866
- Date: Sun, 29 Jul 2018 11:25:24 +0000 (UTC)
commit 584451529dca7ff0089cecf8604352349500a5d9
Author: Nelson Benítez León <nbenitezl gmail com>
Date: Sun Jul 29 16:21:14 2018 +0500
ev-view.c: do scroll only on one axis at a time. Issue #866
libview/ev-view.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 6c0e5e71..cbe1c2f4 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4273,6 +4273,19 @@ ev_view_scroll_event (GtkWidget *widget, GdkEventScroll *event)
return FALSE;
}
+ /* Do scroll only on one axis at a time. Issue #866 */
+ if (event->direction == GDK_SCROLL_SMOOTH &&
+ event->delta_x != 0.0 && event->delta_y != 0.0) {
+ gdouble abs_x, abs_y;
+ abs_x = fabs(event->delta_x);
+ abs_y = fabs(event->delta_y);
+
+ if (abs_y > abs_x)
+ event->delta_x = 0.0;
+ else if (abs_x > abs_y)
+ event->delta_y = 0.0;
+ }
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]