about summary refs log tree commit diff stats
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
parent7b6d5ff29863e4bc7ba787357133ffb9bc5157e6 (diff)
downloaddwm-8a6679b3b4999559059df3ae9e08951099511036.tar.gz
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 'client.c')
-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)
 			DefaultVisual(dpy, screen),
 			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
 
-	if(clients)
-		clients->prev = c;
-	c->next = clients;
-	clients = c;
-
 	grabbuttons(c, False);
-
 	if((tc = getclient(trans))) /* inherit tags */
 		for(i = 0; i < ntags; i++)
 			c->tags[i] = tc->tags[i];
@@ -246,6 +240,9 @@ manage(Window w, XWindowAttributes *wa)
 		c->isfloat = trans
 			|| (c->maxw && c->minw &&
 				c->maxw == c->minw && c->maxh == c->minh);
+
+	attach(c);
+
 	settitle(c);
 	if(isvisible(c))
 		sel = c;
@@ -407,12 +404,7 @@ unmanage(Client *c)
 	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
 	XDestroyWindow(dpy, c->twin);
 
-	if(c->prev)
-		c->prev->next = c->next;
-	if(c->next)
-		c->next->prev = c->prev;
-	if(c == clients)
-		clients = c->next;
+	detach(c);
 	if(sel == c) {
 		if(trans && (tc = getclient(trans)) && isvisible(tc))
 			sel = tc;