aboutsummaryrefslogtreecommitdiffstats
path: root/tag.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-18 11:38:31 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-18 11:38:31 +0200
commit4f8b08d330a6c377ab919f48b8e922d1c5ded601 (patch)
treebcfed5668645ef87fd2b7c3ff0d757912169f016 /tag.c
parent849e631510ed6533ac930449804e477fe67a43c2 (diff)
downloaddwm-4f8b08d330a6c377ab919f48b8e922d1c5ded601.tar.gz
added heretag command which allows to tag a client of a foreign tag with current tag
Diffstat (limited to 'tag.c')
-rw-r--r--tag.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/tag.c b/tag.c
index 5da5711..3837fbd 100644
--- a/tag.c
+++ b/tag.c
@@ -49,7 +49,7 @@ dofloat(Arg *arg)
ban(c);
}
if(sel && !sel->tags[tsel]) {
- if((sel = getnext(clients))) {
+ if((sel = getnext(clients, tsel))) {
higher(sel);
focus(sel);
}
@@ -106,7 +106,7 @@ dotile(Arg *arg)
ban(c);
}
if(!sel || (sel && !sel->tags[tsel])) {
- if((sel = getnext(clients))) {
+ if((sel = getnext(clients, tsel))) {
higher(sel);
focus(sel);
}
@@ -115,13 +115,32 @@ dotile(Arg *arg)
}
Client *
-getnext(Client *c)
+getnext(Client *c, unsigned int t)
{
- for(; c && !c->tags[tsel]; c = c->next);
+ for(; c && !c->tags[t]; c = c->next);
return c;
}
void
+heretag(Arg *arg)
+{
+ 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
replacetag(Arg *arg)
{
int i;