tag.c
changeset 93 c498da7520c7
parent 84 052fe7498930
child 94 6efe82c775c9
--- a/tag.c	Tue Jul 18 08:18:54 2006 +0200
+++ b/tag.c	Tue Jul 18 11:38:31 2006 +0200
@@ -49,7 +49,7 @@
 			ban(c);
 	}
 	if(sel && !sel->tags[tsel]) {
-		if((sel = getnext(clients))) {
+		if((sel = getnext(clients, tsel))) {
 			higher(sel);
 			focus(sel);
 		}
@@ -106,7 +106,7 @@
 			ban(c);
 	}
 	if(!sel || (sel && !sel->tags[tsel])) {
-		if((sel = getnext(clients))) {
+		if((sel = getnext(clients, tsel))) {
 			higher(sel);
 			focus(sel);
 		}
@@ -115,10 +115,29 @@
 }
 
 Client *
-getnext(Client *c)
+getnext(Client *c, unsigned int t)
+{
+	for(; c && !c->tags[t]; c = c->next);
+	return c;
+}
+
+void
+heretag(Arg *arg)
 {
-	for(; c && !c->tags[tsel]; c = c->next);
-	return c;
+	int i;
+	Client *c;
+
+	if(arg->i == tsel)
+		return;
+
+	if(!(c = getnext(clients, arg->i)))
+		return;
+
+	for(i = 0; i < TLast; i++)
+		c->tags[i] = NULL;
+	c->tags[tsel] = tags[tsel];
+	arrange(NULL);
+	focus(c);
 }
 
 void