[gedit] tab: tune number of milliseconds for the scroll timeout



commit 0476a1d44e6c83391cad102747f92ceb3fd1d8d7
Author: Sébastien Wilmet <swilmet informatique-libre be>
Date:   Wed Jul 27 10:55:38 2022 +0200

    tab: tune number of milliseconds for the scroll timeout
    
    See https://gitlab.gnome.org/GNOME/gedit/-/issues/42
    
    It works for small files (100 lines with all small lines).
    Works for large files (100k lines with all small lines).
    Works for medium-sized file with long lines.
    
    So, good enough for now.

 gedit/gedit-tab.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index bede8d914..f5d2d9b5e 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -1058,7 +1058,11 @@ scroll_idle_cb (GeditTab *tab)
         */
        if (tab->scroll_timeout == 0)
        {
-               tab->scroll_timeout = g_timeout_add (250, (GSourceFunc)scroll_timeout_cb, tab);
+               /* Same number of ms as GtkSearchEntry::search-changed delay.
+                * Small enough to not be noticeable, but needs to be at least a
+                * few frames from the GdkFrameClock (during app startup).
+                */
+               tab->scroll_timeout = g_timeout_add (150, (GSourceFunc)scroll_timeout_cb, tab);
        }
 
        tab->scroll_idle = 0;


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