screen.c
changeset 785 179a71394e49
parent 784 74722317b171
child 786 d9198e713310
--- a/screen.c	Mon Feb 19 17:00:32 2007 +0100
+++ b/screen.c	Mon Feb 19 17:12:26 2007 +0100
@@ -19,7 +19,7 @@
 typedef struct {
 	const char *prop;
 	const char *tags;
-	Bool swimming;
+	Bool versatile;
 } Rule;
 
 typedef struct {
@@ -52,7 +52,7 @@
 			if(c->isbanned)
 				XMoveWindow(dpy, c->win, c->x, c->y);
 			c->isbanned = False;
-			if(c->swimming)
+			if(c->versatile)
 				continue;
 			c->ismax = False;
 			nx = wax;
@@ -175,10 +175,10 @@
 	drawstatus();
 	if(!sel)
 		return;
-	if(sel->swimming || lt->arrange == swim)
+	if(sel->versatile || lt->arrange == versatile)
 		XRaiseWindow(dpy, sel->win);
-	if(lt->arrange != swim) {
-		if(!sel->swimming)
+	if(lt->arrange != versatile) {
+		if(!sel->versatile)
 			XLowerWindow(dpy, sel->win);
 		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
 			if(c == sel)
@@ -208,7 +208,7 @@
 				ch.res_name ? ch.res_name : "", c->name);
 		for(i = 0; i < nrules; i++)
 			if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
-				c->swimming = rule[i].swimming;
+				c->versatile = rule[i].versatile;
 				for(j = 0; regs[i].tagregex && j < ntags; j++) {
 					if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
 						matched = True;
@@ -227,29 +227,6 @@
 }
 
 void
-swim(void) {
-	Client *c;
-
-	for(c = clients; c; c = c->next) {
-		if(isvisible(c)) {
-			if(c->isbanned)
-				XMoveWindow(dpy, c->win, c->x, c->y);
-			c->isbanned = False;
-			resize(c, c->x, c->y, c->w, c->h, True);
-		}
-		else {
-			c->isbanned = True;
-			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
-		}
-	}
-	if(!sel || !isvisible(sel)) {
-		for(c = stack; c && !isvisible(c); c = c->snext);
-		focus(c);
-	}
-	restack();
-}
-
-void
 tag(Arg *arg) {
 	unsigned int i;
 
@@ -263,14 +240,6 @@
 }
 
 void
-toggleswimming(Arg *arg) {
-	if(!sel || lt->arrange == swim)
-		return;
-	sel->swimming = !sel->swimming;
-	lt->arrange();
-}
-
-void
 toggletag(Arg *arg) {
 	unsigned int i;
 
@@ -299,6 +268,14 @@
 }
 
 void
+toggleversatile(Arg *arg) {
+	if(!sel || lt->arrange == versatile)
+		return;
+	sel->versatile = !sel->versatile;
+	lt->arrange();
+}
+
+void
 toggleview(Arg *arg) {
 	unsigned int i;
 
@@ -310,6 +287,29 @@
 }
 
 void
+versatile(void) {
+	Client *c;
+
+	for(c = clients; c; c = c->next) {
+		if(isvisible(c)) {
+			if(c->isbanned)
+				XMoveWindow(dpy, c->win, c->x, c->y);
+			c->isbanned = False;
+			resize(c, c->x, c->y, c->w, c->h, True);
+		}
+		else {
+			c->isbanned = True;
+			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+		}
+	}
+	if(!sel || !isvisible(sel)) {
+		for(c = stack; c && !isvisible(c); c = c->snext);
+		focus(c);
+	}
+	restack();
+}
+
+void
 view(Arg *arg) {
 	unsigned int i;