diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 90f0222ee6..4e497c1178 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -1222,6 +1222,10 @@ captured_scroll_cb (GtkEventControllerScroll *scroll, gtk_scrolled_window_cancel_deceleration (scrolled_window); + if (!may_hscroll (scrolled_window) && + !may_vscroll (scrolled_window)) + return GDK_EVENT_PROPAGATE; + if (priv->smooth_scroll) { scrolled_window_scroll (scrolled_window, delta_x, delta_y, scroll); @@ -1412,6 +1416,10 @@ scroll_controller_scroll (GtkEventControllerScroll *scroll, GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window); + if (!may_hscroll (scrolled_window) && + !may_vscroll (scrolled_window)) + return GDK_EVENT_PROPAGATE; + if (!priv->smooth_scroll) scrolled_window_scroll (scrolled_window, delta_x, delta_y, scroll);