summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2008-05-27 22:50:49 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-05-27 22:50:49 +0000
commit8d5e58b632f0be7d1354f4b750efb4604017080e (patch)
treef070a52f7aee8a063cce010093f67eca1de0cfd3 /gtk/gtkspinbutton.c
parent4b1bba8af178f4047913940d0a507b4efe7d90bf (diff)
downloadgtk+-8d5e58b632f0be7d1354f4b750efb4604017080e.tar.gz
106574 - Inconsistent increment behavior for gtkspinbutton
* gtk/gtkspinbutton.c (gtk_spin_button_real_value_change): Commit the entry text before doing an increment. Patch by Björn Lindqvist. svn path=/trunk/; revision=20196
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 2218e1e1f0..a9eca0d3ec 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -1266,7 +1266,15 @@ static void
gtk_spin_button_real_change_value (GtkSpinButton *spin,
GtkScrollType scroll)
{
- gdouble old_value = spin->adjustment->value;
+ gdouble old_value;
+
+ /* When the key binding is activated, there may be an outstanding
+ * value, so we first have to commit what is currently written in
+ * the spin buttons text entry. See #106574
+ */
+ gtk_spin_button_update (spin);
+
+ old_value = spin->adjustment->value;
/* We don't test whether the entry is editable, since
* this key binding conceptually corresponds to changing