summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-08-29 09:23:44 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-08-29 09:23:44 +0200
commit8a6679b3b4999559059df3ae9e08951099511036 (patch)
tree7b8c4ac2e4647caffba13638cac03c183c7faab2 /client.c
parentremoved crappy variables (diff)
downloaddwm-8a6679b3b4999559059df3ae9e08951099511036.tar.gz
dwm-8a6679b3b4999559059df3ae9e08951099511036.zip
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Diffstat (limited to '')
-rw-r--r--client.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/client.c b/client.c
index 9c0428a..0a7df77 100644
--- a/client.c
+++ b/client.c
@@ -230,13 +230,7 @@ manage(Window w, XWindowAttributes *wa)
230 DefaultVisual(dpy, screen), 230 DefaultVisual(dpy, screen),
231 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); 231 CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
232 232
233 if(clients)
234 clients->prev = c;
235 c->next = clients;
236 clients = c;
237
238 grabbuttons(c, False); 233 grabbuttons(c, False);
239
240 if((tc = getclient(trans))) /* inherit tags */ 234 if((tc = getclient(trans))) /* inherit tags */
241 for(i = 0; i < ntags; i++) 235 for(i = 0; i < ntags; i++)
242 c->tags[i] = tc->tags[i]; 236 c->tags[i] = tc->tags[i];
@@ -246,6 +240,9 @@ manage(Window w, XWindowAttributes *wa)
246 c->isfloat = trans 240 c->isfloat = trans
247 || (c->maxw && c->minw && 241 || (c->maxw && c->minw &&
248 c->maxw == c->minw && c->maxh == c->minh); 242 c->maxw == c->minw && c->maxh == c->minh);
243
244 attach(c);
245
249 settitle(c); 246 settitle(c);
250 if(isvisible(c)) 247 if(isvisible(c))
251 sel = c; 248 sel = c;
@@ -407,12 +404,7 @@ unmanage(Client *c)
407 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 404 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
408 XDestroyWindow(dpy, c->twin); 405 XDestroyWindow(dpy, c->twin);
409 406
410 if(c->prev) 407 detach(c);
411 c->prev->next = c->next;
412 if(c->next)
413 c->next->prev = c->prev;
414 if(c == clients)
415 clients = c->next;
416 if(sel == c) { 408 if(sel == c) {
417 if(trans && (tc = getclient(trans)) && isvisible(tc)) 409 if(trans && (tc = getclient(trans)) && isvisible(tc))
418 sel = tc; 410 sel = tc;