wmii

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

commit 6eb557892db84f37f2faee86df8743d802a0b3f3
parent 5d513c750599fe7726d84ae01b16c1bf931c8cf1
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Mon,  6 Mar 2006 19:03:53 +0100

disabling update_ctags on detach_client (on unmap update_ctags attaches the detached client again, how bad)


Diffstat:
cmd/wm/client.c | 27---------------------------
cmd/wm/tag.c | 30++++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -317,22 +317,6 @@ gravitate(Client *c, Bool invert) } void -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); - XMapWindow(dpy, c->framewin); -} - -void attach_client(Client *c) { Tag *t; @@ -347,16 +331,6 @@ attach_client(Client *c) } 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); -} - -void detach_client(Client *c, Bool unmap) { int i; @@ -370,7 +344,6 @@ detach_client(Client *c, Bool unmap) 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 @@ -233,3 +233,33 @@ update_ctags() } } } + +void +detach_fromtag(Tag *t, Client *c, Bool unmap) +{ + int i; + char *p = strstr(c->tags, t->name); + fprintf(stderr, "%s %s %s\n", c->tags, t->name, p); + if(p) + memmove(p, p + strlen(t->name), strlen(p + strlen(t->name))); + fprintf(stderr, "%s %s %s\n", c->tags, t->name, p); + for(i = 0; i < t->narea; i++) + if(clientofarea(t->area[i], c)) + detach_fromarea(t->area[i], c); +} + +void +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); + XMapWindow(dpy, c->framewin); +}