diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2018-07-18 16:34:39 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2018-07-18 16:36:18 +0300 |
commit | 3ebd1c3fe77809a80ff1d647ba2d368b5aea0623 (patch) | |
tree | b2ca961755b63110be132fca51cd8ecc53d27084 /gtk/gtkcalendar.c | |
parent | 0750b4fd28eedf0782825e1b1f932b912c07c6c7 (diff) | |
download | gtk+-scroll-event-propagation.tar.gz |
eventcontrollerscroll: Conditionally propagate ::scrollscroll-event-propagation
Currently, gtk_event_controller_scroll_handle_event() always returns
TRUE if it is handled, which stops the propagation of the event. If
there’s a single GtkEventControllerScroll in the widget hierarchy, that
means that no others will run, depending on the propagation phase. In
Nautilus, this can be observed when adding a scroll controller to the
GtkScrolledWindow (ctrl-scrolling controls the zoom level) - either the
scrolling or the zooming breaks.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/45
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r-- | gtk/gtkcalendar.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 643b86e5b9..c45df9200d 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -340,10 +340,10 @@ static gint calendar_get_xsep (GtkCalendar *calendar); static gint calendar_get_ysep (GtkCalendar *calendar); static gint calendar_get_inner_border (GtkCalendar *calendar); -static void gtk_calendar_scroll_controller_scroll (GtkEventControllerScroll *scroll, - gdouble dx, - gdouble dy, - GtkWidget *widget); +static gboolean gtk_calendar_scroll_controller_scroll (GtkEventControllerScroll *scroll, + gdouble dx, + gdouble dy, + GtkWidget *widget); static char *default_abbreviated_dayname[7]; static char *default_monthname[12]; @@ -2686,7 +2686,7 @@ gtk_calendar_drag_update (GtkGestureDrag *gesture, gtk_drag_set_icon_default (drag); } -static void +static gboolean gtk_calendar_scroll_controller_scroll (GtkEventControllerScroll *scroll, gdouble dx, gdouble dy, @@ -2701,6 +2701,8 @@ gtk_calendar_scroll_controller_scroll (GtkEventControllerScroll *scroll, calendar_set_month_prev (calendar); else if (dy > 0) calendar_set_month_next (calendar); + + return TRUE; } |