about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c8
-rw-r--r--view.c50
2 files changed, 9 insertions, 49 deletions
diff --git a/client.c b/client.c
index 46693cd..586a87f 100644
--- a/client.c
+++ b/client.c
@@ -99,14 +99,6 @@ focus(Client *c)
 		}
 	}
 	if(c) {
-		if((c->isfloat || arrange == dofloat) && (c != clients)) {
-			detach(c);
-			if(clients) {
-				clients->prev = c;
-				c->next = clients;
-			}
-			clients = c;
-		}
 		grabbuttons(c, True);
 		drawtitle(c);
 		XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
diff --git a/view.c b/view.c
index ce122ed..3b5abba 100644
--- a/view.c
+++ b/view.c
@@ -215,52 +215,20 @@ resizecol(Arg *arg)
 void
 restack()
 {
-	static unsigned int nwins = 0;
-	static Window *wins = NULL;
-	unsigned int f, fi, m, mi, n;
 	Client *c;
 	XEvent ev;
-
-	for(f = 0, m = 0, c = clients; c; c = c->next)
-		if(isvisible(c)) {
-			if(c->isfloat || arrange == dofloat)
-				f++;
-			else
-				m++;
-		}
-	if(!(n = 2 * (f + m))) {
-		drawstatus();
+	
+	if(!sel)
 		return;
+	if(sel->isfloat || arrange == dofloat) {
+		XRaiseWindow(dpy, sel->win);
+		XRaiseWindow(dpy, sel->twin);
 	}
-	if(nwins < n) {
-		nwins = n;
-		wins = erealloc(wins, nwins * sizeof(Window));
-	}
-
-	fi = 0;
-	mi = 2 * f;
-	if(sel) {
-		if(sel->isfloat || arrange == dofloat) {
-			wins[fi++] = sel->twin;
-			wins[fi++] = sel->win;
-		}
-		else {
-			wins[mi++] = sel->twin;
-			wins[mi++] = sel->win;
-		}
-	}
-	for(c = clients; c; c = c->next)
-		if(isvisible(c) && c != sel) {
-			if(c->isfloat || arrange == dofloat) {
-				wins[fi++] = c->twin;
-				wins[fi++] = c->win;
-			}
-			else {
-				wins[mi++] = c->twin;
-				wins[mi++] = c->win;
-			}
+	if(arrange != dofloat) 
+		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
+			XLowerWindow(dpy, c->twin);
+			XLowerWindow(dpy, c->win);
 		}
-	XRestackWindows(dpy, wins, n);
 	drawall();
 	XSync(dpy, False);
 	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
'>5497090a ^
9636c7ae ^

5497090a ^
9636c7ae ^

a91c1c2a ^
5497090a ^
9636c7ae ^
5497090a ^
9636c7ae ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40