[gnome-system-monitor] Start the network chart only after we have data to display, one second later than we start the other



commit 57c54205d9897519772e2209a2755dd74b88e9a6
Author: Robert Roth <robert roth off gmail com>
Date:   Sun Apr 28 00:54:50 2013 +0300

    Start the network chart only after we have data to display, one second
    later than we start the others.
    https://bugzilla.gnome.org/show_bug.cgi?id=626846

 src/load-graph.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 62a6e26..d313f76 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -552,7 +552,7 @@ get_net (LoadGraph *graph)
     guint64 in = 0, out = 0;
     GTimeVal time;
     guint64 din, dout;
-
+    gboolean first = true;
     ifnames = glibtop_get_netlist(&netlist);
 
     for (i = 0; i < netlist.number; ++i)
@@ -599,11 +599,13 @@ get_net (LoadGraph *graph)
         dout = 0;
     }
 
+    first = first && (graph->net.time.tv_sec==0);
     graph->net.last_in  = in;
     graph->net.last_out = out;
     graph->net.time     = time;
 
-    net_scale(graph, din, dout);
+    if (!first)
+        net_scale(graph, din, dout);
 
     gtk_label_set_text (GTK_LABEL (graph->labels.net_in), procman::format_network_rate(din).c_str());
     gtk_label_set_text (GTK_LABEL (graph->labels.net_in_total), procman::format_network(in).c_str());


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