Mercurial > aewl
annotate view.c @ 524:1a9a0877650c
keep master ratio on resizecol -> arrange
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Thu, 05 Oct 2006 12:59:35 +0200 |
parents | c1dd19da63ef |
children | c71952fa3c7c |
rev | line source |
---|---|
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
1 /* |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
3 * See LICENSE file for license details. |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
4 */ |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
5 #include "dwm.h" |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
6 |
380
4bf79305d675
this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents:
378
diff
changeset
|
7 /* static */ |
4bf79305d675
this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents:
378
diff
changeset
|
8 |
382 | 9 static Client * |
487 | 10 minclient(void) { |
382 | 11 Client *c, *min; |
12 | |
443
548084f8d92e
this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents:
442
diff
changeset
|
13 if((clients && clients->isfloat) || arrange == dofloat) |
548084f8d92e
this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents:
442
diff
changeset
|
14 return clients; /* don't touch floating order */ |
382 | 15 for(min = c = clients; c; c = c->next) |
16 if(c->weight < min->weight) | |
17 min = c; | |
18 return min; | |
19 } | |
20 | |
480 | 21 static Client * |
22 nexttiled(Client *c) { | |
23 for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); | |
24 return c; | |
25 } | |
26 | |
442 | 27 static void |
487 | 28 reorder(void) { |
382 | 29 Client *c, *newclients, *tail; |
381
b00cc483d13b
still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents:
380
diff
changeset
|
30 |
382 | 31 newclients = tail = NULL; |
32 while((c = minclient())) { | |
381
b00cc483d13b
still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents:
380
diff
changeset
|
33 detach(c); |
382 | 34 if(tail) { |
35 c->prev = tail; | |
36 tail->next = c; | |
37 tail = c; | |
381
b00cc483d13b
still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents:
380
diff
changeset
|
38 } |
b00cc483d13b
still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents:
380
diff
changeset
|
39 else |
382 | 40 tail = newclients = c; |
380
4bf79305d675
this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents:
378
diff
changeset
|
41 } |
382 | 42 clients = newclients; |
380
4bf79305d675
this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents:
378
diff
changeset
|
43 } |
4bf79305d675
this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents:
378
diff
changeset
|
44 |
480 | 45 static void |
46 togglemax(Client *c) | |
47 { | |
481 | 48 XEvent ev; |
480 | 49 if((c->ismax = !c->ismax)) { |
50 c->rx = c->x; c->x = sx; | |
51 c->ry = c->y; c->y = bh; | |
502 | 52 c->rw = c->w; c->w = sw - 2 * BORDERPX; |
53 c->rh = c->h; c->h = sh - bh - 2 * BORDERPX; | |
480 | 54 } |
55 else { | |
56 c->x = c->rx; | |
57 c->y = c->ry; | |
481 | 58 c->w = c->rw; |
59 c->h = c->rh; | |
480 | 60 } |
61 resize(c, True, TopLeft); | |
62 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | |
430
1e8aba00964e
no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents:
429
diff
changeset
|
63 } |
1e8aba00964e
no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents:
429
diff
changeset
|
64 |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
65 /* extern */ |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
66 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
67 void (*arrange)(Arg *) = DEFMODE; |
505
2c29d74b11dc
first step to a more flexible dotile() algorithm
Anselm R. Garbe <arg@10kloc.org>
parents:
504
diff
changeset
|
68 StackPos stackpos = STACKPOS; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
69 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
70 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
71 detach(Client *c) { |
378
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
72 if(c->prev) |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
73 c->prev->next = c->next; |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
74 if(c->next) |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
75 c->next->prev = c->prev; |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
76 if(c == clients) |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
77 clients = c->next; |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
78 c->next = c->prev = NULL; |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
79 } |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
80 |
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
81 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
82 dofloat(Arg *arg) { |
402 | 83 Client *c; |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
397
diff
changeset
|
84 |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
85 for(c = clients; c; c = c->next) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
86 if(isvisible(c)) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
87 resize(c, True, TopLeft); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
88 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
89 else |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
90 ban(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
91 } |
446
a2e587651c79
using a global stack for focus recovery on arrange() - seems to work great
Anselm R. Garbe <arg@10kloc.org>
parents:
443
diff
changeset
|
92 if(!sel || !isvisible(sel)) { |
450
728c9089b079
applied sanders patch of not manipulating sel
Anselm R. Garbe <arg@10kloc.org>
parents:
446
diff
changeset
|
93 for(c = stack; c && !isvisible(c); c = c->snext); |
728c9089b079
applied sanders patch of not manipulating sel
Anselm R. Garbe <arg@10kloc.org>
parents:
446
diff
changeset
|
94 focus(c); |
446
a2e587651c79
using a global stack for focus recovery on arrange() - seems to work great
Anselm R. Garbe <arg@10kloc.org>
parents:
443
diff
changeset
|
95 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
96 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
97 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
98 |
504 | 99 /* This algorithm is based on a (M)aster area and a (S)tacking area. |
100 * It supports following arrangements: | |
507 | 101 * SSMMM MMMMM MMMSS |
102 * SSMMM SSSSS MMMSS | |
504 | 103 */ |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
104 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
105 dotile(Arg *arg) { |
507 | 106 int i, n, stackw, stackh, tw, th; |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
107 unsigned int md = ((stackpos == StackBottom ? sh - bh : sw) * master) / 100; |
402 | 108 Client *c; |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
397
diff
changeset
|
109 |
488 | 110 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) |
111 n++; | |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
112 |
507 | 113 if(stackpos == StackBottom) { |
114 stackw = sw; | |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
115 stackh = sh - bh - md; |
507 | 116 } |
117 else { | |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
118 stackw = sw - md; |
507 | 119 stackh = sh - bh; |
120 } | |
121 | |
511
1599c953647b
removed the direction flipping
Anselm R. Garbe <arg@10kloc.org>
parents:
510
diff
changeset
|
122 tw = stackw; |
1599c953647b
removed the direction flipping
Anselm R. Garbe <arg@10kloc.org>
parents:
510
diff
changeset
|
123 if(n > 1) |
1599c953647b
removed the direction flipping
Anselm R. Garbe <arg@10kloc.org>
parents:
510
diff
changeset
|
124 th = stackh / (n - 1); |
1599c953647b
removed the direction flipping
Anselm R. Garbe <arg@10kloc.org>
parents:
510
diff
changeset
|
125 else |
507 | 126 th = stackh; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
127 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
128 for(i = 0, c = clients; c; c = c->next) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
129 if(isvisible(c)) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
130 if(c->isfloat) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
131 resize(c, True, TopLeft); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
132 continue; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
133 } |
488 | 134 c->ismax = False; |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
135 c->x = sx; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
136 c->y = sy + bh; |
507 | 137 if(n == 1) { /* only 1 window */ |
502 | 138 c->w = sw - 2 * BORDERPX; |
139 c->h = sh - 2 * BORDERPX - bh; | |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
140 } |
507 | 141 else if(i == 0) { /* master window */ |
522 | 142 if(stackpos == StackLeft) |
143 c->x += stackw; | |
508
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
144 switch(stackpos) { |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
145 case StackLeft: |
522 | 146 case StackRight: |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
147 c->w = md - 2 * BORDERPX; |
508
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
148 c->h = sh - bh - 2 * BORDERPX; |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
149 break; |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
150 case StackBottom: |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
151 c->w = sw - 2 * BORDERPX; |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
152 c->h = md - 2 * BORDERPX; |
508
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
153 break; |
507 | 154 } |
155 } | |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
156 else { /* tile window */ |
522 | 157 if(stackpos == StackRight) |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
158 c->x += md; |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
159 if(th > bh) { |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
160 switch(stackpos) { |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
161 case StackLeft: |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
162 case StackRight: |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
163 c->y = sy + (i - 1) * th + bh; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
164 if(i + 1 == n) |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
165 c->h = sh - c->y - 2 * BORDERPX; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
166 break; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
167 case StackBottom: |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
168 c->y = sy + md + (i - 1) * th + bh; |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
169 if(i + 1 == n) |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
170 c->h = sh - c->y - 2 * BORDERPX; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
171 break; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
172 } |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
173 c->w = tw - 2 * BORDERPX; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
174 c->h = th - 2 * BORDERPX; |
507 | 175 } |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
176 else { /* fallback if th < bh */ |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
177 if(stackpos == StackBottom) |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
178 c->y += md; |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
179 c->w = stackw - 2 * BORDERPX; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
180 c->h = stackh - 2 * BORDERPX; |
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
181 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
182 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
183 resize(c, False, TopLeft); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
184 i++; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
185 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
186 else |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
187 ban(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
188 } |
446
a2e587651c79
using a global stack for focus recovery on arrange() - seems to work great
Anselm R. Garbe <arg@10kloc.org>
parents:
443
diff
changeset
|
189 if(!sel || !isvisible(sel)) { |
450
728c9089b079
applied sanders patch of not manipulating sel
Anselm R. Garbe <arg@10kloc.org>
parents:
446
diff
changeset
|
190 for(c = stack; c && !isvisible(c); c = c->snext); |
728c9089b079
applied sanders patch of not manipulating sel
Anselm R. Garbe <arg@10kloc.org>
parents:
446
diff
changeset
|
191 focus(c); |
446
a2e587651c79
using a global stack for focus recovery on arrange() - seems to work great
Anselm R. Garbe <arg@10kloc.org>
parents:
443
diff
changeset
|
192 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
193 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
194 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
195 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
196 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
197 focusnext(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
198 Client *c; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
199 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
200 if(!sel) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
201 return; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
202 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
203 if(!(c = getnext(sel->next))) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
204 c = getnext(clients); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
205 if(c) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
206 focus(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
207 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
208 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
209 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
210 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
211 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
212 focusprev(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
213 Client *c; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
214 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
215 if(!sel) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
216 return; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
217 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
218 if(!(c = getprev(sel->prev))) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
219 for(c = clients; c && c->next; c = c->next); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
220 c = getprev(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
221 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
222 if(c) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
223 focus(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
224 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
225 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
226 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
227 |
420 | 228 Bool |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
229 isvisible(Client *c) { |
420 | 230 unsigned int i; |
231 | |
232 for(i = 0; i < ntags; i++) | |
233 if(c->tags[i] && seltag[i]) | |
234 return True; | |
235 return False; | |
236 } | |
237 | |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
238 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
239 resizecol(Arg *arg) { |
423
6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents:
422
diff
changeset
|
240 unsigned int n; |
6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents:
422
diff
changeset
|
241 Client *c; |
418 | 242 |
430
1e8aba00964e
no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents:
429
diff
changeset
|
243 for(n = 0, c = clients; c; c = c->next) |
1e8aba00964e
no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents:
429
diff
changeset
|
244 if(isvisible(c) && !c->isfloat) |
423
6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents:
422
diff
changeset
|
245 n++; |
486 | 246 if(!sel || sel->isfloat || n < 2 || (arrange == dofloat)) |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
247 return; |
423
6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents:
422
diff
changeset
|
248 |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
249 if(sel == getnext(clients)) { |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
250 if(master + arg->i > 95 || master + arg->i < 5) |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
251 return; |
505
2c29d74b11dc
first step to a more flexible dotile() algorithm
Anselm R. Garbe <arg@10kloc.org>
parents:
504
diff
changeset
|
252 master += arg->i; |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
253 } |
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
254 else { |
524
1a9a0877650c
keep master ratio on resizecol -> arrange
Anselm R. Garbe <arg@10kloc.org>
parents:
523
diff
changeset
|
255 if(master - arg->i > 95 || master - arg->i < 5) |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
256 return; |
505
2c29d74b11dc
first step to a more flexible dotile() algorithm
Anselm R. Garbe <arg@10kloc.org>
parents:
504
diff
changeset
|
257 master -= arg->i; |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
258 } |
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
259 arrange(NULL); |
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
260 } |
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
261 |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
262 void |
487 | 263 restack(void) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
264 Client *c; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
265 XEvent ev; |
481 | 266 |
437
433a5c662f73
drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents:
436
diff
changeset
|
267 if(!sel) { |
433a5c662f73
drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents:
436
diff
changeset
|
268 drawstatus(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
269 return; |
437
433a5c662f73
drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents:
436
diff
changeset
|
270 } |
436
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
271 if(sel->isfloat || arrange == dofloat) { |
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
272 XRaiseWindow(dpy, sel->win); |
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
273 XRaiseWindow(dpy, sel->twin); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
274 } |
512
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
275 if(arrange != dofloat) { |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
276 if(!sel->isfloat) { |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
277 XLowerWindow(dpy, sel->twin); |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
278 XLowerWindow(dpy, sel->win); |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
279 } |
436
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
280 for(c = nexttiled(clients); c; c = nexttiled(c->next)) { |
512
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
281 if(c == sel) |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
282 continue; |
436
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
283 XLowerWindow(dpy, c->twin); |
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
284 XLowerWindow(dpy, c->win); |
414
c6ffcc201229
don't access sel in restack without checking for NULL (multihead crashing bug)
Anselm R. Garbe <arg@10kloc.org>
parents:
402
diff
changeset
|
285 } |
512
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
286 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
287 drawall(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
288 XSync(dpy, False); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
289 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
290 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
291 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
292 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
293 togglemode(Arg *arg) { |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
294 arrange = (arrange == dofloat) ? dotile : dofloat; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
295 if(sel) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
296 arrange(NULL); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
297 else |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
298 drawstatus(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
299 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
300 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
301 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
302 toggleview(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
303 unsigned int i; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
304 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
305 seltag[arg->i] = !seltag[arg->i]; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
306 for(i = 0; i < ntags && !seltag[i]; i++); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
307 if(i == ntags) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
308 seltag[arg->i] = True; /* cannot toggle last view */ |
381
b00cc483d13b
still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents:
380
diff
changeset
|
309 reorder(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
310 arrange(NULL); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
311 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
312 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
313 void |
508
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
314 togglestackpos(Arg *arg) { |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
315 if(arrange == dofloat) |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
316 return; |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
317 if(stackpos == StackBottom) |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
318 stackpos = STACKPOS; |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
319 else |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
320 stackpos = StackBottom; |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
321 arrange(NULL); |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
322 } |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
323 |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
324 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
325 view(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
326 unsigned int i; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
327 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
328 for(i = 0; i < ntags; i++) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
329 seltag[i] = False; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
330 seltag[arg->i] = True; |
381
b00cc483d13b
still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents:
380
diff
changeset
|
331 reorder(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
332 arrange(NULL); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
333 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
334 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
335 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
336 viewall(Arg *arg) { |
395
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
337 unsigned int i; |
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
338 |
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
339 for(i = 0; i < ntags; i++) |
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
340 seltag[i] = True; |
397
cb8a231610c7
reorder was misssing in Ross version of viewall
Anselm R. Garbe <arg@10kloc.org>
parents:
395
diff
changeset
|
341 reorder(); |
395
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
342 arrange(NULL); |
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
343 } |
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
344 |
508
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
345 |
ede48935f2b3
added the new dotile as described on ml
Anselm R. Garbe <arg@10kloc.org>
parents:
507
diff
changeset
|
346 |
395
7528080beb0e
added viewall to mainstream (only Ross Mohns version, not the toggle)
Anselm R. Garbe <arg@10kloc.org>
parents:
393
diff
changeset
|
347 void |
461
9d23330a5268
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
Anselm R. Garbe <arg@10kloc.org>
parents:
450
diff
changeset
|
348 zoom(Arg *arg) { |
423
6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents:
422
diff
changeset
|
349 unsigned int n; |
6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents:
422
diff
changeset
|
350 Client *c; |
473
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
351 |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
352 if(!sel) |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
353 return; |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
354 |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
355 if(sel->isfloat || (arrange == dofloat)) { |
480 | 356 togglemax(sel); |
473
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
357 return; |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
358 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
359 |
430
1e8aba00964e
no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents:
429
diff
changeset
|
360 for(n = 0, c = clients; c; c = c->next) |
1e8aba00964e
no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents:
429
diff
changeset
|
361 if(isvisible(c) && !c->isfloat) |
423
6ba5dd429122
applied checking existance of >2 tiles patch (proposed by sander) to zoom and resizecol
Anselm R. Garbe <arg@10kloc.org>
parents:
422
diff
changeset
|
362 n++; |
486 | 363 if(n < 2 || (arrange == dofloat)) |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
364 return; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
365 |
430
1e8aba00964e
no, reodering floating clients definately breaks the manage() policy which attaches all clients zoomed (otherwise higher-weight clients couldn't be attached zoomed, which sucks)
Anselm R. Garbe <arg@10kloc.org>
parents:
429
diff
changeset
|
366 if((c = sel) == nexttiled(clients)) |
433 | 367 if(!(c = nexttiled(c->next))) |
429
a31de8605f72
no, ordering floating clients at the end seems better
Anselm R. Garbe <arg@10kloc.org>
parents:
428
diff
changeset
|
368 return; |
443
548084f8d92e
this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents:
442
diff
changeset
|
369 detach(c); |
548084f8d92e
this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents:
442
diff
changeset
|
370 if(clients) |
548084f8d92e
this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents:
442
diff
changeset
|
371 clients->prev = c; |
548084f8d92e
this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents:
442
diff
changeset
|
372 c->next = clients; |
548084f8d92e
this patch keeps track of global z-layer order of clients which are floating or if floating mode is enabled
Anselm R. Garbe <arg@10kloc.org>
parents:
442
diff
changeset
|
373 clients = c; |
378
83576f5f0a90
added attach/detach functions which don't attach at the begin of list, but at the slot of a first match of the tags of a client
Anselm R. Garbe <arg@10kloc.org>
parents:
342
diff
changeset
|
374 focus(c); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
375 arrange(NULL); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
376 } |