From: Benjamin Otte Date: Thu, 20 Apr 2023 17:00:08 +0000 (+0200) Subject: adjustment: sanity-check values when setting them X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~389^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=75c47755;p=gtk4.git adjustment: sanity-check values when setting them It's not enough to sanitize values when starting an animation, as the adjustment can reconfigure itself while the animation runs. So as a simple way to handle this, we sanitize every value right before setting it, too. In the future we might also want to look at sanitizing start/end values of the animation. Fixes #5763 --- diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c index 2516d43cfd..fc41931069 100644 --- a/gtk/gtkadjustment.c +++ b/gtk/gtkadjustment.c @@ -434,6 +434,8 @@ adjustment_set_value (GtkAdjustment *adjustment, { GtkAdjustmentPrivate *priv = gtk_adjustment_get_instance_private (adjustment); + value = gtk_adjustment_sanitize_value (adjustment, value); + if (priv->value != value) { priv->value = value;