summaryrefslogtreecommitdiff
path: root/gtk/gtkcombobox.c
diff options
context:
space:
mode:
authorNelson Benítez León <nbenitezl@gmail.com>2022-01-19 15:33:03 -0400
committerNelson Benítez León <nbenitezl@gmail.com>2022-01-20 20:05:39 -0400
commitd1bf21ea43ae601542e94193907d56794bcc87fd (patch)
treef4feb4608d7ff135e66e22ec4c4491fdd7dcede5 /gtk/gtkcombobox.c
parent10efc3cb0d8e30f4d7ac31da2cc904606a921ffe (diff)
downloadgtk+-combos_not_scroll.tar.gz
containers that can be scrolled should have precedencecombos_not_scroll
over child widgets that also react to scrolling like GtkComboBox, GtkScale and GtkSpinButton, because otherwise when you're in the middle of scrolling the view/window you can involuntarily scroll over the widgets and change its values. This problem can be seen in applications like pavucontrol, gnome-tweaks prefs, devhelp prefs, and so on. Fixes issue #3092
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r--gtk/gtkcombobox.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index ef4996c027..57fbbd6e0c 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -2707,8 +2707,12 @@ gtk_combo_box_scroll_event (GtkWidget *widget,
GtkTreeIter iter;
GtkTreeIter new_iter;
+ /* Scrolling the parent window/container takes precedence - Issue #3092 */
+ if (gtk_widget_inside_scrollable_container (widget))
+ return GDK_EVENT_PROPAGATE;
+
if (!gtk_combo_box_get_active_iter (combo_box, &iter))
- return TRUE;
+ return GDK_EVENT_STOP;
if (event->direction == GDK_SCROLL_UP)
found = tree_prev (combo_box, priv->model,
@@ -2720,7 +2724,7 @@ gtk_combo_box_scroll_event (GtkWidget *widget,
if (found)
gtk_combo_box_set_active_iter (combo_box, &new_iter);
- return TRUE;
+ return GDK_EVENT_STOP;
}
/*