From 124ce62dd28742415b6834a0f742a41082b1722f Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Wed, 16 Dec 2020 15:14:15 +1300 Subject: [PATCH] Use the scroll multiplier that the Chromium source uses. Fixes https://github.com/flutter/flutter/issues/71385 --- engine/src/flutter/shell/platform/linux/fl_view.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/linux/fl_view.cc b/engine/src/flutter/shell/platform/linux/fl_view.cc index f6cd10b13d..4c63f4a0b3 100644 --- a/engine/src/flutter/shell/platform/linux/fl_view.cc +++ b/engine/src/flutter/shell/platform/linux/fl_view.cc @@ -332,9 +332,9 @@ static gboolean fl_view_scroll_event(GtkWidget* widget, GdkEventScroll* event) { return FALSE; } - // TODO(robert-ancell): See if this can be queried from the OS; this value is - // chosen arbitrarily to get something that feels reasonable. - const int kScrollOffsetMultiplier = 20; + // The multiplier is taken from the Chromium source + // (ui/events/x/events_x_utils.cc). + const int kScrollOffsetMultiplier = 53; scroll_delta_x *= kScrollOffsetMultiplier; scroll_delta_y *= kScrollOffsetMultiplier;