ports/sysutils/xstatbar/patches/patch-xstatbar_c

53 lines
1.4 KiB
Text

Hunk #1: parse properly options on archs where char is unsigned
by default (arm, ppc)
Index: xstatbar.c
--- xstatbar.c.orig
+++ xstatbar.c
@@ -51,7 +51,7 @@ main (int argc, char *argv[])
{
const char *errstr;
char *font;
- char ch;
+ int ch;
int x, y, w, h;
int sleep_seconds;
@@ -297,9 +297,10 @@ draw_divider(XColor color, int x, int width)
void
draw()
{
+ XEvent dummy;
static int spacing = 10;
int x, y;
- int cpu;
+ int cpu, firstcpu = 1;
/* paint over the existing pixmap */
XSetForeground(XINFO.disp, XINFO.gc, BlackPixel(XINFO.disp, XINFO.screen));
@@ -311,9 +312,15 @@ draw()
x = 0;
/* start drawing stats */
- for (cpu = 0; cpu < sysinfo.ncpu; cpu++)
- x += cpu_draw(cpu, COLOR_WHITE, x, y) + spacing;
+ for (cpu = 0; cpu < sysinfo.ncpu; cpu++) {
+ /* SMT CPU is offline (hw.smt=0) */
+ if(!sysinfo.cpu_online[cpu])
+ continue;
+ x += cpu_draw(cpu, COLOR_WHITE, x, y, firstcpu) + spacing;
+ firstcpu = 0;
+ }
+
x += mem_draw(COLOR_WHITE, x, y) + spacing;
x += procs_draw(COLOR_WHITE, x, y) + spacing;
x += power_draw(COLOR_WHITE, x, y) + spacing;
@@ -323,6 +330,7 @@ draw()
/* copy the buffer to the window and flush */
XCopyArea(XINFO.disp, XINFO.buf, XINFO.win, XINFO.gc,
0, 0, XINFO.width, XINFO.height, 0, 0);
+ XNextEvent(XINFO.disp, &dummy);
XFlush(XINFO.disp);
}