[gtk+/gtk-3-10] treeview: Lower the duration of validation iterations



commit 8fdda90a45a845f8b86a8e323f5e5f879a74cedf
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Mar 22 12:47:55 2014 +0100

    treeview: Lower the duration of validation iterations
    
    GTK_TREE_VIEW_TIME_MS_PER_IDLE is currently 30 milliseconds, meaning
    that validate_rows will validate rows up until all the validations have
    taken over 30 msecs. So it's likely to block redrawing via the clock
    frame update mechanism, as that tops at 16.66 milliseconds per frame
    (1/60th of a second).
    
    Stop validating rows if we've spent more than 3/5 of our allotted budget
    for inter-frame processing, so as to avoid blocking.
    
    In the future, we would probably want to calculate how long we would
    have left until the next frame, especially if higher priority idles
    and timeouts have already consumed a portion of that allotted time.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726871

 gtk/gtktreeview.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 663e1c7..f910637 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -239,7 +239,8 @@ typedef enum {
 
 #define GTK_TREE_VIEW_PRIORITY_VALIDATE (GDK_PRIORITY_REDRAW + 5)
 #define GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC (GTK_TREE_VIEW_PRIORITY_VALIDATE + 2)
-#define GTK_TREE_VIEW_TIME_MS_PER_IDLE 30
+/* 3/5 of gdkframeclockidle.c's FRAME_INTERVAL (16667 microsecs) */
+#define GTK_TREE_VIEW_TIME_MS_PER_IDLE 10
 #define SCROLL_EDGE_SIZE 15
 #define GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT 5000
 #define AUTO_EXPAND_TIMEOUT 500


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