commit 33c9c936fb89a2c55ad5f4f8d398b8a07561202a
parent 2fd5866c98b641467e707d001e3bc0874f430c43
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Wed, 18 Jan 2006 18:52:09 +0200
also frames and bar labels begin with index 1 now
Diffstat:
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/cmd/wm/frame.c b/cmd/wm/frame.c
@@ -17,7 +17,7 @@ Frame *
alloc_frame(XRectangle * r)
{
XSetWindowAttributes wa;
- static int id = 0;
+ static int id = 1;
char buf[MAX_BUF];
Frame *f = (Frame *) cext_emallocz(sizeof(Frame));
int bw, th;
diff --git a/cmd/wmiibar.c b/cmd/wmiibar.c
@@ -37,7 +37,7 @@ struct Item {
Item *next;
};
-static unsigned int id = 0;
+static unsigned int id = 1;
static IXPServer *ixps = 0;
static Display *dpy;
static GC gc;
@@ -135,11 +135,11 @@ reset(void *obj, char *arg)
{
int i;
char buf[512];
- for(i = 0; i < id; i++) {
+ for(i = 1; i <= id; i++) {
snprintf(buf, sizeof(buf), "/%d", i);
ixps->remove(ixps, buf);
}
- id = 0;
+ id = 1;
draw_bar(0, 0);
}
@@ -215,8 +215,9 @@ draw()
if(!nitems)
return;
- expandable = blitz_strtonum(file[B_EXPANDABLE]->content, 0, nitems);
+ expandable = blitz_strtonum(file[B_EXPANDABLE]->content, 1, nitems + 1);
snprintf(buf, sizeof(buf), "/%d", expandable);
+ expandable--;
if(!ixp_walk(ixps, buf))
expandable = 0;
@@ -277,7 +278,7 @@ draw_bar(void *obj, char *arg)
free(i);
}
it = items = nil;
- snprintf(buf, sizeof(buf), "%s", "/0");
+ snprintf(buf, sizeof(buf), "%s", "/1");
label = ixp_walk(ixps, buf);
if(!label) {
Draw d = { 0 };