ScrolledWindow: Unset cursor if child takes scroll

https://gitlab.gnome.org/GNOME/gtk/issues/1053
This commit is contained in:
Daniel Boles 2018-05-05 11:40:43 +01:00
parent 2ce63a86ba
commit 133e8fc03f

View File

@ -1399,6 +1399,8 @@ scroll_history_finish (GtkScrolledWindow *sw,
return TRUE;
}
static void uninstall_scroll_cursor (GtkScrolledWindow *scrolled_window);
static gboolean
captured_event_cb (GtkWidget *widget,
GdkEvent *event)
@ -1416,7 +1418,14 @@ captured_event_cb (GtkWidget *widget,
if (event->type == GDK_SCROLL)
{
GtkWidget *scrollable_child = gtk_bin_get_child (GTK_BIN (widget));
gtk_scrolled_window_cancel_deceleration (sw);
/* If a nested widget takes over the scroll, unset our scrolling cursor */
if (gtk_get_event_widget (event) != scrollable_child)
uninstall_scroll_cursor (sw);
return GDK_EVENT_PROPAGATE;
}