[geary/mjog/email-templates: 7/15] ConversationViewer: Avoid re-enabling kinetic scrolling if disabled



commit 2cd43de8eee10d376963c3df642b78f894c8e035
Author: Michael Gratton <mike vee net>
Date:   Mon Apr 20 11:20:37 2020 +1000

    ConversationViewer: Avoid re-enabling kinetic scrolling if disabled

 src/client/conversation-viewer/conversation-viewer.vala | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index dbb50c4d..f04a1d26 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -179,10 +179,11 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
         );
         embed.vanished.connect(on_composer_closed);
 
-        // We need to disable kinetic scrolling so that if it still
-        // has some momentum when the composer is inserted and
-        // scrolled to, it won't jump away again. See Bug 778027.
-        conversation_scroller.kinetic_scrolling = false;
+        // We need to temporarily disable kinetic scrolling so that if
+        // it still has some momentum when the composer is inserted
+        // and scrolled to, it won't jump away again. See Bug 778027.
+        var kinetic = this.conversation_scroller.kinetic_scrolling;
+        if (kinetic) this.conversation_scroller.kinetic_scrolling = false;
 
         if (this.current_list != null) {
             this.current_list.add_embedded_composer(
@@ -192,7 +193,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
             composer.update_window_title();
         }
 
-        conversation_scroller.kinetic_scrolling = true;
+        if (kinetic) this.conversation_scroller.kinetic_scrolling = true;
     }
 
     /**


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