[libdazzle] suggestion: avoid jitter when updating new model



commit 6c73d17869730809060a0e7f99699c19c2e77f5d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 6 18:05:11 2017 -0700

    suggestion: avoid jitter when updating new model
    
    We can get out of sync from Y=0 when changing the model. This tries to
    reset things to 0 safely.

 src/suggestions/dzl-suggestion-popover.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/suggestions/dzl-suggestion-popover.c b/src/suggestions/dzl-suggestion-popover.c
index ead5e87..bd00464 100644
--- a/src/suggestions/dzl-suggestion-popover.c
+++ b/src/suggestions/dzl-suggestion-popover.c
@@ -707,6 +707,15 @@ dzl_suggestion_popover_connect (DzlSuggestionPopover *self)
 
   /* select the first row */
   dzl_suggestion_popover_move_by (self, 1);
+
+  /* If we started animating, cancel it to avoid such jarring movement. */
+  if (self->scroll_anim != NULL)
+    {
+      dzl_animation_stop (self->scroll_anim);
+      dzl_clear_weak_pointer (&self->scroll_anim);
+    }
+
+  gtk_adjustment_set_value (gtk_scrolled_window_get_vadjustment (self->scrolled_window), 0.0);
 }
 
 static void


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