wmii

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

commit 5d513c750599fe7726d84ae01b16c1bf931c8cf1
parent 8a85f71a24eb05f32b82b2f3ac2f3b22b1f1c60b
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Mon,  6 Mar 2006 18:34:57 +0100

proceeded with detach_client fixes, still annoying


Diffstat:
cmd/wm/area.c | 7-------
cmd/wm/client.c | 18++++++++++++++----
cmd/wm/tag.c | 1+
3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/cmd/wm/area.c b/cmd/wm/area.c @@ -129,16 +129,10 @@ attach_toarea(Area *a, Client *c) a->frame = (Frame **)cext_array_attach( (void **)a->frame, f, sizeof(Frame *), &a->framesz); a->nframe++; - if(!strstr(c->tags, a->tag->name)) { - if(c->tags[0] != 0) - cext_strlcat(c->tags, " ", sizeof(c->tags)); - cext_strlcat(c->tags, a->tag->name, sizeof(c->tags)); - } if(area2index(a)) /* column */ arrange_area(a); else /* floating */ resize_client(c, &f->rect, nil, False); - update_ctags(); } void @@ -160,7 +154,6 @@ detach_fromarea(Area *a, Client *c) destroy_area(a); arrange_tag(t, True); } - update_ctags(); } char * diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -321,6 +321,11 @@ attach_totag(Tag *t, Client *c) { Area *a = t->area[t->sel]; + if(!strstr(c->tags, t->name)) { + if(c->tags[0] != 0) + cext_strlcat(c->tags, " ", sizeof(c->tags)); + cext_strlcat(c->tags, t->name, sizeof(c->tags)); + } reparent_client(c, c->framewin, c->rect.x, c->rect.y); attach_toarea(a, c); map_client(c); @@ -338,12 +343,14 @@ attach_client(Client *c) attach_totag(t, c); focus_client(c); + update_ctags(); } void detach_fromtag(Tag *t, Client *c, Bool unmap) { int i; + for(i = 0; i < t->narea; i++) if(clientofarea(t->area[i], c)) detach_fromarea(t->area[i], c); @@ -357,10 +364,13 @@ detach_client(Client *c, Bool unmap) detach_fromtag(tag[i], c, unmap); if(!unmap) unmap_client(c); - c->rect.x = c->frame->rect.x; - c->rect.y = c->frame->rect.y; - reparent_client(c, root, c->rect.x, c->rect.y); - XUnmapWindow(dpy, c->framewin); + if(c->frame) { + c->rect.x = c->frame->rect.x; + c->rect.y = c->frame->rect.y; + reparent_client(c, root, c->rect.x, c->rect.y); + XUnmapWindow(dpy, c->framewin); + } + update_ctags(); } Client * diff --git a/cmd/wm/tag.c b/cmd/wm/tag.c @@ -191,6 +191,7 @@ update_ctags() char buf[256]; char *tags[128]; + fprintf(stderr, "%s", "update_ctags\n"); for(i = 0; i < nctag; i++) { Bool exists = False; for(j = 0; j < nclient; j++)