diff src/bar_histogram.c @ 1439:2441a90c4bcf

compute histogram in idle time
author nadvornik
date Sun, 15 Mar 2009 11:34:09 +0000
parents c520cfd40aef
children e015b6573d36
line wrap: on
line diff
--- a/src/bar_histogram.c	Sun Mar 15 09:06:13 2009 +0000
+++ b/src/bar_histogram.c	Sun Mar 15 11:34:09 2009 +0000
@@ -83,7 +83,11 @@
 	
 	histmap = histmap_get(phd->fd);
 	
-	if (!histmap) return FALSE;
+	if (!histmap) 
+		{
+		histmap_start_idle(phd->fd);
+		return FALSE;
+		}
 	
 	phd->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, phd->histogram_width, phd->histogram_height);
 	gdk_pixbuf_fill(phd->pixbuf, 0xffffffff);
@@ -126,7 +130,7 @@
 static void bar_pane_histogram_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
 	PaneHistogramData *phd = data;
-	if (fd == phd->fd) bar_pane_histogram_update(phd);
+	if ((type & (NOTIFY_REREAD | NOTIFY_CHANGE | NOTIFY_HISTMAP | NOTIFY_PIXBUF)) && fd == phd->fd) bar_pane_histogram_update(phd);
 }
 
 static gboolean bar_pane_histogram_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)