summaryrefslogtreecommitdiffstats
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
parentusing EXIT_stuff in exit() now (diff)
downloaddwm-4f8b08d330a6c377ab919f48b8e922d1c5ded601.tar.gz
dwm-4f8b08d330a6c377ab919f48b8e922d1c5ded601.zip
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)
49 ban(c); 49 ban(c);
50 } 50 }
51 if(sel && !sel->tags[tsel]) { 51 if(sel && !sel->tags[tsel]) {
52 if((sel = getnext(clients))) { 52 if((sel = getnext(clients, tsel))) {
53 higher(sel); 53 higher(sel);
54 focus(sel); 54 focus(sel);
55 } 55 }
@@ -106,7 +106,7 @@ dotile(Arg *arg)
106 ban(c); 106 ban(c);
107 } 107 }
108 if(!sel || (sel && !sel->tags[tsel])) { 108 if(!sel || (sel && !sel->tags[tsel])) {
109 if((sel = getnext(clients))) { 109 if((sel = getnext(clients, tsel))) {
110 higher(sel); 110 higher(sel);
111 focus(sel); 111 focus(sel);
112 } 112 }
@@ -115,13 +115,32 @@ dotile(Arg *arg)
115} 115}
116 116
117Client * 117Client *
118getnext(Client *c) 118getnext(Client *c, unsigned int t)
119{ 119{
120 for(; c && !c->tags[tsel]; c = c->next); 120 for(; c && !c->tags[t]; c = c->next);
121 return c; 121 return c;
122} 122}
123 123
124void 124void
125heretag(Arg *arg)
126{
127 int i;
128 Client *c;
129
130 if(arg->i == tsel)
131 return;
132
133 if(!(c = getnext(clients, arg->i)))
134 return;
135
136 for(i = 0; i < TLast; i++)
137 c->tags[i] = NULL;
138 c->tags[tsel] = tags[tsel];
139 arrange(NULL);
140 focus(c);
141}
142
143void
125replacetag(Arg *arg) 144replacetag(Arg *arg)
126{ 145{
127 int i; 146 int i;