summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.h2
-rw-r--r--tag.c3
-rw-r--r--view.c33
3 files changed, 1 insertions, 37 deletions
diff --git a/dwm.h b/dwm.h
index 37151f9..18672d0 100644
--- a/dwm.h
+++ b/dwm.h
@@ -82,7 +82,7 @@ struct Client {
82 int basew, baseh, incw, inch, maxw, maxh, minw, minh; 82 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
83 int grav; 83 int grav;
84 long flags; 84 long flags;
85 unsigned int border, weight; 85 unsigned int border;
86 Bool isfloat, isfixed, ismax; 86 Bool isfloat, isfixed, ismax;
87 Bool *tags; 87 Bool *tags;
88 Client *next; 88 Client *next;
diff --git a/tag.c b/tag.c
index 798fd0a..fd08853 100644
--- a/tag.c
+++ b/tag.c
@@ -104,7 +104,6 @@ settags(Client *c, Client *trans) {
104 if(!matched) 104 if(!matched)
105 for(i = 0; i < ntags; i++) 105 for(i = 0; i < ntags; i++)
106 c->tags[i] = seltag[i]; 106 c->tags[i] = seltag[i];
107 for(c->weight = 0; c->weight < ntags && !c->tags[c->weight]; c->weight++);
108} 107}
109 108
110void 109void
@@ -116,7 +115,6 @@ tag(Arg *arg) {
116 for(i = 0; i < ntags; i++) 115 for(i = 0; i < ntags; i++)
117 sel->tags[i] = False; 116 sel->tags[i] = False;
118 sel->tags[arg->i] = True; 117 sel->tags[arg->i] = True;
119 sel->weight = arg->i;
120 arrange(); 118 arrange();
121} 119}
122 120
@@ -130,6 +128,5 @@ toggletag(Arg *arg) {
130 for(i = 0; i < ntags && !sel->tags[i]; i++); 128 for(i = 0; i < ntags && !sel->tags[i]; i++);
131 if(i == ntags) 129 if(i == ntags)
132 sel->tags[arg->i] = True; 130 sel->tags[arg->i] = True;
133 sel->weight = (i == ntags) ? arg->i : i;
134 arrange(); 131 arrange();
135} 132}
diff --git a/view.c b/view.c
index bd43da9..e7d7a99 100644
--- a/view.c
+++ b/view.c
@@ -6,42 +6,12 @@
6/* static */ 6/* static */
7 7
8static Client * 8static Client *
9minclient(void) {
10 Client *c, *min;
11
12 if((clients && clients->isfloat) || arrange == dofloat)
13 return clients; /* don't touch floating order */
14 for(min = c = clients; c; c = c->next)
15 if(c->weight < min->weight)
16 min = c;
17 return min;
18}
19
20static Client *
21nexttiled(Client *c) { 9nexttiled(Client *c) {
22 for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); 10 for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
23 return c; 11 return c;
24} 12}
25 13
26static void 14static void
27reorder(void) {
28 Client *c, *newclients, *tail;
29
30 newclients = tail = NULL;
31 while((c = minclient())) {
32 detach(c);
33 if(tail) {
34 c->prev = tail;
35 tail->next = c;
36 tail = c;
37 }
38 else
39 tail = newclients = c;
40 }
41 clients = newclients;
42}
43
44static void
45togglemax(Client *c) { 15togglemax(Client *c) {
46 XEvent ev; 16 XEvent ev;
47 17
@@ -247,7 +217,6 @@ toggleview(Arg *arg) {
247 for(i = 0; i < ntags && !seltag[i]; i++); 217 for(i = 0; i < ntags && !seltag[i]; i++);
248 if(i == ntags) 218 if(i == ntags)
249 seltag[arg->i] = True; /* cannot toggle last view */ 219 seltag[arg->i] = True; /* cannot toggle last view */
250 reorder();
251 arrange(); 220 arrange();
252} 221}
253 222
@@ -258,7 +227,6 @@ view(Arg *arg) {
258 for(i = 0; i < ntags; i++) 227 for(i = 0; i < ntags; i++)
259 seltag[i] = False; 228 seltag[i] = False;
260 seltag[arg->i] = True; 229 seltag[arg->i] = True;
261 reorder();
262 arrange(); 230 arrange();
263} 231}
264 232
@@ -268,7 +236,6 @@ viewall(Arg *arg) {
268 236
269 for(i = 0; i < ntags; i++) 237 for(i = 0; i < ntags; i++)
270 seltag[i] = True; 238 seltag[i] = True;
271 reorder();
272 arrange(); 239 arrange();
273} 240}
274 241