mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-10 12:40:10 +00:00
Merge branch '1053-scroll-cursor-gets-left-behind-if-a-child-widget-steals-the-scroll' into 'gtk-3-22'
Resolve "Scroll cursor gets left behind if a child widget steals the scroll" See merge request GNOME/gtk!134
This commit is contained in:
commit
08f31f8f4a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user