aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-web-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-web-view.c')
-rw-r--r--widgets/misc/e-web-view.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c
index f58b5d44de..07f8357609 100644
--- a/widgets/misc/e-web-view.c
+++ b/widgets/misc/e-web-view.c
@@ -969,7 +969,27 @@ web_view_scroll_event (GtkWidget *widget,
GdkEventScroll *event)
{
if (event->state & GDK_CONTROL_MASK) {
- switch (event->direction) {
+ GdkScrollDirection direction = event->direction;
+
+ #if GTK_CHECK_VERSION(3,3,18)
+ if (direction == GDK_SCROLL_SMOOTH) {
+ static gdouble total_delta_y = 0.0;
+
+ total_delta_y += event->delta_y;
+
+ if (total_delta_y >= 1.0) {
+ total_delta_y = 0.0;
+ direction = GDK_SCROLL_DOWN;
+ } else if (total_delta_y <= -1.0) {
+ total_delta_y = 0.0;
+ direction = GDK_SCROLL_UP;
+ } else {
+ return FALSE;
+ }
+ }
+ #endif
+
+ switch (direction) {
case GDK_SCROLL_UP:
e_web_view_zoom_in (E_WEB_VIEW (widget));
return TRUE;