adjustment: sanity-check values when setting them
authorBenjamin Otte <otte@redhat.com>
Thu, 20 Apr 2023 17:00:08 +0000 (19:00 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 20 Apr 2023 21:33:28 +0000 (23:33 +0200)
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

gtk/gtkadjustment.c

index 2516d43cfd9589d5790ca5ac3f681f9c0d9d2406..fc41931069e6f318eb230b19b3814d3cf9625fab 100644 (file)
@@ -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;