[gtk/wip/carlosg/revealer-fix-interrupted-animations] revealer: Fully set the target state if unmapped during animation



commit 32ad0ffa0f14612670e4f23ff8ee01798894caae
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Dec 19 19:26:04 2018 +0100

    revealer: Fully set the target state if unmapped during animation
    
    If the revealer is told do animate and then unrealize itself, we do
    (correctly) stop the animation, but used to do a shortcut where we
    just set the target state as current.
    
    Other things are dependent on the animation properly finishing though,
    like the contained widget child visibility. This may lead to inconsistent
    state where gtk_revealer_get_child_revealed() returns TRUE but the child
    widget is unmapped, or vice-versa.
    
    Fully finish the animation here, so the child state is coherent the next
    time the revealer is mapped. We can also skip notifying on the property
    since it will be handled by gtk_revealer_set_position().
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/316

 gtk/gtkrevealer.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index 84cb1ca851..7560293114 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -633,10 +633,7 @@ gtk_revealer_stop_animation (GtkRevealer *revealer)
 {
   GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
   if (priv->current_pos != priv->target_pos)
-    {
-      priv->current_pos = priv->target_pos;
-      g_object_notify_by_pspec (G_OBJECT (revealer), props[PROP_CHILD_REVEALED]);
-    }
+    gtk_revealer_set_position (revealer, priv->target_pos);
   if (priv->tick_id != 0)
     {
       gtk_widget_remove_tick_callback (GTK_WIDGET (revealer), priv->tick_id);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]