Commit 9d7f1cac authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Matthias Clasen

textview: Avoid relocating adjustments on ::size-allocate while these are animating

An animation may be scheduled while the textview content changed in size, so the resize
queued would just unset the animation and set the adjusments with a current value,
defeating gtk_text_view_scroll_to_iter(). In this case, just avoid the adjustment change,
as there is a target value on the way.

https://bugzilla.gnome.org/show_bug.cgi?id=733406
parent 2bf368c9
......@@ -1017,3 +1017,9 @@ gtk_adjustment_get_animation_duration (GtkAdjustment *adjustment)
{
return adjustment->priv->duration;
}
gboolean
gtk_adjustment_is_animating (GtkAdjustment *adjustment)
{
return adjustment->priv->tick_id != 0;
}
......@@ -32,6 +32,8 @@ void gtk_adjustment_animate_to_value (GtkAdjustment *adjustment,
gdouble value);
gdouble gtk_adjustment_get_target_value (GtkAdjustment *adjustment);
gboolean gtk_adjustment_is_animating (GtkAdjustment *adjustment);
G_END_DECLS
......
......@@ -3887,8 +3887,10 @@ gtk_text_view_size_allocate (GtkWidget *widget,
gtk_text_view_allocate_children (text_view);
/* Update adjustments */
gtk_text_view_set_hadjustment_values (text_view);
gtk_text_view_set_vadjustment_values (text_view);
if (!gtk_adjustment_is_animating (priv->hadjustment))
gtk_text_view_set_hadjustment_values (text_view);
if (!gtk_adjustment_is_animating (priv->vadjustment))
gtk_text_view_set_vadjustment_values (text_view);
/* The GTK resize loop processes all the pending exposes right
* after doing the resize stuff, so the idle sizer won't have a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment