All pastes #1446964 Raw Edit

lxpanel cpu history patch

public diff v1 · immutable
#1446964 ·published 2009-06-04 00:26 UTC
rendered paste body
--- a/src/plugins/cpu/cpu.c	2008-12-10 15:37:34.452819574 -0600+++ b/src/plugins/cpu/cpu.c	2009-06-03 18:28:59.904598839 -0500@@ -116,11 +116,17 @@     ENTER;     if (c->pixmap)         g_object_unref(c->pixmap);+tick *t0;+t0=  g_new0( typeof(*c->stats_cpu), widget->allocation.width);+unsigned int imax;+imax=c->Wwg > widget->allocation.width? widget->allocation.width:c->Wwg;+memcpy(t0,c->stats_cpu,imax*sizeof(tick));+     c->Wwg = widget->allocation.width;     c->Hwg = widget->allocation.height;     if (c->stats_cpu)         g_free(c->stats_cpu);-    c->stats_cpu = g_new0( typeof(*c->stats_cpu), c->Wwg);+c->stats_cpu = t0;     /* set pixmap size */     c->pixmap = gdk_pixmap_new (widget->window,           widget->allocation.width-BORDER_SIZE * 2,