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/gtkcombobox.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/gtkcombobox.c')
-rw-r--r-- | gtk/gtkcombobox.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index f5844ad572..6893b8edcc 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -248,7 +248,7 @@ static void gtk_combo_box_real_move_active (GtkComboBox *combo_box, static void gtk_combo_box_real_popup (GtkComboBox *combo_box); static gboolean gtk_combo_box_real_popdown (GtkComboBox *combo_box); -static void gtk_combo_box_scroll_controller_scroll (GtkEventControllerScroll *scroll, +static gboolean gtk_combo_box_scroll_controller_scroll (GtkEventControllerScroll *scroll, gdouble dx, gdouble dy, GtkComboBox *combo_box); @@ -1798,7 +1798,7 @@ tree_first (GtkComboBox *combo, return search_data.set; } -static void +static gboolean gtk_combo_box_scroll_controller_scroll (GtkEventControllerScroll *scroll, gdouble dx, gdouble dy, @@ -1810,7 +1810,7 @@ gtk_combo_box_scroll_controller_scroll (GtkEventControllerScroll *scroll, GtkTreeIter new_iter; if (!gtk_combo_box_get_active_iter (combo_box, &iter)) - return; + return FALSE; if (dy < 0) found = tree_prev (combo_box, priv->model, &iter, &new_iter); @@ -1820,6 +1820,8 @@ gtk_combo_box_scroll_controller_scroll (GtkEventControllerScroll *scroll, if (found) gtk_combo_box_set_active_iter (combo_box, &new_iter); + return found; + } /* callbacks */ |