Re-enable non-smooth scrolling. (flutter/engine#26549)

Since 0561c75b4d events are now handled in a GtkEventBox and the duplicate
scroll events no longer occur.

Fixes https://github.com/flutter/flutter/issues/73823
This commit is contained in:
Robert Ancell
2021-06-25 08:06:05 +12:00
committed by GitHub
parent edefd0add8
commit 3fa5f09847

View File

@@ -485,14 +485,14 @@ static gboolean event_box_scroll_event(GtkWidget* widget,
if (event->direction == GDK_SCROLL_SMOOTH) {
scroll_delta_x = event->delta_x;
scroll_delta_y = event->delta_y;
} else {
// We currently skip non-smooth scroll events due to the X11 events being
// delivered directly to the FlView X window and bypassing the GtkWindow
// handling.
// This causes both smooth and non-smooth events to be received (i.e.
// duplication).
// https://github.com/flutter/flutter/issues/73823
return FALSE;
} else if (event->direction == GDK_SCROLL_UP) {
scroll_delta_y = -1;
} else if (event->direction == GDK_SCROLL_DOWN) {
scroll_delta_y = 1;
} else if (event->direction == GDK_SCROLL_LEFT) {
scroll_delta_x = -1;
} else if (event->direction == GDK_SCROLL_RIGHT) {
scroll_delta_x = 1;
}
// The multiplier is taken from the Chromium source