aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 3f67a345d1..2f81863cb5 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1031,6 +1031,19 @@ static gboolean gd_scroll_event(GtkWidget *widget, GdkEventScroll *scroll,
btn = INPUT_BUTTON_WHEEL_UP;
} else if (scroll->direction == GDK_SCROLL_DOWN) {
btn = INPUT_BUTTON_WHEEL_DOWN;
+#if GTK_CHECK_VERSION(3, 4, 0)
+ } else if (scroll->direction == GDK_SCROLL_SMOOTH) {
+ gdouble delta_x, delta_y;
+ if (!gdk_event_get_scroll_deltas((GdkEvent *)scroll,
+ &delta_x, &delta_y)) {
+ return TRUE;
+ }
+ if (delta_y > 0) {
+ btn = INPUT_BUTTON_WHEEL_DOWN;
+ } else {
+ btn = INPUT_BUTTON_WHEEL_UP;
+ }
+#endif
} else {
return TRUE;
}