[Nautilus-list] Eel patch



I just commited the appended patch to eel. I believe it is correct, and it 
helps nautilus performance quite a bit, since without it we call update on 
all items and repaint the visible area every time we relayout during a 
directory load.

I may be fucking something up though, so I'd like comments on the patch.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/eel/ChangeLog,v
retrieving revision 1.351
diff -u -p -r1.351 ChangeLog
--- ChangeLog	14 Apr 2002 00:19:14 -0000	1.351
+++ ChangeLog	14 Apr 2002 16:23:56 -0000
@@ -1,3 +1,9 @@
+2002-04-14  Alexander Larsson  <alla lysator liu se>
+
+	* eel/eel-gnome-extensions.c (eel_gnome_canvas_set_scroll_region):
+	Don't request_update all item unless the top left corner of
+	the scroll region changed.
+
 2002-04-13  Alexander Larsson  <alla lysator liu se>
 
 	* eel/eel-gnome-extensions.c (eel_gnome_shell_execute):
Index: eel/eel-gnome-extensions.c
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-gnome-extensions.c,v
retrieving revision 1.30
diff -u -p -r1.30 eel-gnome-extensions.c
--- eel/eel-gnome-extensions.c	14 Apr 2002 00:19:15 -0000	1.30
+++ eel/eel-gnome-extensions.c	14 Apr 2002 16:23:57 -0000
@@ -336,6 +336,11 @@ eel_gnome_canvas_request_update_all (Gno
  * even though it should. The update is in there with an #if 0 around
  * it, with no explanation of why it's commented out. For now, work
  * around this by requesting an update explicitly.
+ * ALEX: The update was causing us to repaint everything on every
+ * relayout. An object may have data stored that depends on x1 and y1,
+ * since they decide the coordinate space transform. Nothing should
+ * depend on x2 and y2 though. This lets us grow the canvas to the
+ * right and down without performance problems.
  */
 void
 eel_gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
@@ -348,7 +353,9 @@ eel_gnome_canvas_set_scroll_region (Gnom
 	gnome_canvas_get_scroll_region (canvas, &old_x1, &old_y1, &old_x2, &old_y2);
 	if (old_x1 != x1 || old_y1 != y1 || old_x2 != x2 || old_y2 != y2) {
 		gnome_canvas_set_scroll_region (canvas, x1, y1, x2, y2);
-		eel_gnome_canvas_request_update_all (canvas);
+		if (old_x1 != x1 || old_y1 != y1) {
+			eel_gnome_canvas_request_update_all (canvas);
+		}
 		gnome_canvas_item_request_update (canvas->root);
 	}
 }

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a fast talking soccer-playing dog-catcher haunted by memories of 'Nam. 
She's a strong-willed motormouth socialite with someone else's memories. They 
fight crime! 





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