diff options
author | Matthias Clasen <mclasen@redhat.com> | 2009-05-03 13:04:06 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2009-05-03 13:04:06 -0400 |
commit | e6373738fc9c53c95e467a3681fcd3426fd94d13 (patch) | |
tree | f590ec182722637e3c797ea64337ad3d6f3896a6 /gtk/gtkcombobox.c | |
parent | 46bc2ec740c9c3b86fad9c373342e0851ca0bf43 (diff) | |
download | gtk+-e6373738fc9c53c95e467a3681fcd3426fd94d13.tar.gz |
Forward-port a GtkAdjustment compatibility fix
We reverted GtkAdjustment to its traditional behaviour wrt. to
clamping in 2.14.3, but the fix was lost between 2.14 and 2.16.
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r-- | gtk/gtkcombobox.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 57a975d0ef..eb669a031a 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -4018,13 +4018,13 @@ gtk_combo_box_list_auto_scroll (GtkComboBox *combo_box, adj->lower < adj->value) { value = adj->value - (tree_view->allocation.x - x + 1); - gtk_adjustment_set_value (adj, value); + gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size)); } else if (x >= tree_view->allocation.x + tree_view->allocation.width && adj->upper - adj->page_size > adj->value) { value = adj->value + (x - tree_view->allocation.x - tree_view->allocation.width + 1); - gtk_adjustment_set_value (adj, MAX (value, 0.0)); + gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size)); } } @@ -4035,13 +4035,13 @@ gtk_combo_box_list_auto_scroll (GtkComboBox *combo_box, adj->lower < adj->value) { value = adj->value - (tree_view->allocation.y - y + 1); - gtk_adjustment_set_value (adj, value); + gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size)); } else if (y >= tree_view->allocation.height && adj->upper - adj->page_size > adj->value) { value = adj->value + (y - tree_view->allocation.height + 1); - gtk_adjustment_set_value (adj, MAX (value, 0.0)); + gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size)); } } } |