Mercurial > aewl
comparison tag.c @ 383:2ec9cead84a7
applied patch similiar proposed by dave tweed
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Tue, 29 Aug 2006 17:11:37 +0200 |
parents | b00cc483d13b |
children | 126e78129f1d |
comparison
equal
deleted
inserted
replaced
382:76b62c0c8c11 | 383:2ec9cead84a7 |
---|---|
27 TAGS | 27 TAGS |
28 RULES | 28 RULES |
29 | 29 |
30 static RReg *rreg = NULL; | 30 static RReg *rreg = NULL; |
31 static unsigned int len = 0; | 31 static unsigned int len = 0; |
32 | |
33 static void | |
34 applytag() | |
35 { | |
36 /* asserts sel != NULL */ | |
37 settitle(sel); | |
38 if(!isvisible(sel)) | |
39 arrange(NULL); | |
40 else | |
41 drawstatus(); | |
42 } | |
32 | 43 |
33 /* extern */ | 44 /* extern */ |
34 | 45 |
35 Client * | 46 Client * |
36 getnext(Client *c) | 47 getnext(Client *c) |
119 return; | 130 return; |
120 | 131 |
121 for(i = 0; i < ntags; i++) | 132 for(i = 0; i < ntags; i++) |
122 sel->tags[i] = False; | 133 sel->tags[i] = False; |
123 sel->tags[arg->i] = True; | 134 sel->tags[arg->i] = True; |
124 settitle(sel); | 135 applytag(); |
125 if(!isvisible(sel)) | |
126 arrange(NULL); | |
127 else | |
128 drawstatus(); | |
129 } | 136 } |
130 | 137 |
131 void | 138 void |
132 toggletag(Arg *arg) | 139 toggletag(Arg *arg) |
133 { | 140 { |
138 | 145 |
139 sel->tags[arg->i] = !sel->tags[arg->i]; | 146 sel->tags[arg->i] = !sel->tags[arg->i]; |
140 for(i = 0; i < ntags && !sel->tags[i]; i++); | 147 for(i = 0; i < ntags && !sel->tags[i]; i++); |
141 if(i == ntags) | 148 if(i == ntags) |
142 sel->tags[arg->i] = True; | 149 sel->tags[arg->i] = True; |
143 settitle(sel); | 150 applytag(); |
144 if(!isvisible(sel)) | |
145 arrange(NULL); | |
146 else | |
147 drawstatus(); | |
148 } | 151 } |