[polari] chatView: Block overshoot when fetching logs



commit f498bd651fc93c5b6a1d2c765d59b870c7c75746
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Nov 28 17:24:42 2014 +0000

    chatView: Block overshoot when fetching logs
    
    GTK+ now displays an "overshoot indicator" when the users scrolls
    past the top/bottom to indicate the end of the buffer. However
    while we have history to load, scrolling past the top will prepend
    to the buffer - indicate that we are not at the end in that case
    by suppressing the overshoot indicator.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740132

 src/chatView.js |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 90db494..b3ae78f 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -366,11 +366,13 @@ const ChatView = new Lang.Class({
         if (hasDeltas && dy >= 0)
             return Gdk.EVENT_PROPAGATE;
 
-        if (this._fetchingBacklog ||
-            this.widget.vadjustment.value != 0 ||
+        if (this.widget.vadjustment.value != 0 ||
             this._logWalker.is_end())
             return Gdk.EVENT_PROPAGATE;
 
+        if (this._fetchingBacklog)
+            return Gdk.EVENT_STOP;
+
         this._fetchingBacklog = true;
         Mainloop.timeout_add(500, Lang.bind(this,
             function() {
@@ -378,7 +380,7 @@ const ChatView = new Lang.Class({
                                                  Lang.bind(this, this._onLogEventsReady));
                 return GLib.SOURCE_REMOVE;
             }));
-        return Gdk.EVENT_PROPAGATE;
+        return Gdk.EVENT_STOP;
     },
 
     _onValueChanged: function() {


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