diff --git a/src/ag-window.c b/src/ag-window.c index fcb342f..110b63f 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -565,6 +565,7 @@ ag_window_recalculate_chart(AgWindow *window, gboolean set_everything) GtkTextIter start_iter, end_iter; GsweTimestamp *timestamp; + GtkWidget *current; gint db_id = (priv->saved_data) ? priv->saved_data->db_id : -1; south = gtk_toggle_button_get_active( @@ -575,6 +576,15 @@ ag_window_recalculate_chart(AgWindow *window, gboolean set_everything) GTK_TOGGLE_BUTTON(priv->west_long) ); + // If the current widget is a spin button, force it to update. This is + // required when the user enters a new value in a spin button, but doesn't + // leave the spin entry before switching to the chart tab with an accel. + current = gtk_window_get_focus(GTK_WINDOW(window)); + + if (GTK_IS_SPIN_BUTTON(current)) { + gtk_spin_button_update(GTK_SPIN_BUTTON(current)); + } + edit_data = g_new0(AgDbSave, 1); edit_data->db_id = db_id;