wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 22387a539280727df396b0c261e3cbee22b85686
parent 348311cfe0360fc09b2b745c459bc760ebd83891
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Sat, 11 Mar 2006 20:58:08 +0100

improved draw_client stuff (if area 0 is selected and empty, prev area should not indicate any highlight)


Diffstat:
cmd/wm/area.c | 6++++--
cmd/wm/fs.c | 22+++++++++++++---------
2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/cmd/wm/area.c b/cmd/wm/area.c @@ -106,10 +106,12 @@ select_area(Area *a, char *arg) return; } new = t->area[i]; + t->sel = i; if(new->nframe) focus_client(new->frame[new->sel]->client); - t->sel = i; - fprintf(stderr, "select_area: t->sel == %d\n", t->sel); + else + for(i = 0; i < a->nframe; i++) + draw_client(a->frame[i]->client); } void diff --git a/cmd/wm/fs.c b/cmd/wm/fs.c @@ -1161,6 +1161,16 @@ xstat(IXPConn *c, Fcall *fcall) return nil; } +static void +draw_clients() +{ + unsigned int i, j; + for(i = 0; i < nclient; i++) + for(j = 0; j < client[i]->nframe; j++) + if(client[i]->frame[j]->area->tag == tag[sel]) + draw_client(client[i]); +} + static char * xwrite(IXPConn *c, Fcall *fcall) { @@ -1168,7 +1178,7 @@ xwrite(IXPConn *c, Fcall *fcall) IXPMap *m = ixp_server_fid2map(c, fcall->fid); unsigned char type; unsigned int len; - int i, j, i1 = 0, i2 = 0, i3 = 0; + int i, i1 = 0, i2 = 0, i3 = 0; Frame *f; if(!m) @@ -1304,10 +1314,7 @@ xwrite(IXPConn *c, Fcall *fcall) memcpy(def.selcolor, fcall->data, fcall->count); def.selcolor[fcall->count] = 0; blitz_loadcolor(dpy, screen, def.selcolor, &def.sel); - for(i = 0; i < nclient; i++) - for(j = 0; j < client[i]->nframe; j++) - if(client[i]->frame[j]->area->tag == tag[sel]) - draw_client(client[i]); + draw_clients(); break; case FsFnormcolors: if((fcall->count != 23) @@ -1318,10 +1325,7 @@ xwrite(IXPConn *c, Fcall *fcall) memcpy(def.normcolor, fcall->data, fcall->count); def.normcolor[fcall->count] = 0; blitz_loadcolor(dpy, screen, def.normcolor, &def.norm); - for(i = 0; i < nclient; i++) - for(j = 0; j < client[i]->nframe; j++) - if(client[i]->frame[j]->area->tag == tag[sel]) - draw_client(client[i]); + draw_clients(); break; case FsFkeys: if(def.keyssz < fcall->offset + fcall->count + 1) {