[libdazzle] suggestion: avoid jitter when updating new model
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] suggestion: avoid jitter when updating new model
- Date: Wed, 7 Jun 2017 01:05:20 +0000 (UTC)
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]