Mercurial > aewl
annotate view.c @ 597:7a48d1f06223
improved tag indicator
author | arg@mig29 |
---|---|
date | Fri, 01 Dec 2006 09:52:15 +0100 |
parents | f7dcd3ac8d6f |
children | c7f84f23ec5a |
rev | line source |
---|---|
532
651f2c868b31
code polishing, removed unnecessary newlines
Anselm R. Garbe <arg@10kloc.org>
parents:
531
diff
changeset
|
1 /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
2 * See LICENSE file for license details. |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
3 */ |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
4 #include "dwm.h" |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
5 |
380
4bf79305d675
this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents:
378
diff
changeset
|
6 /* static */ |
4bf79305d675
this algorithm seems to keep order for any scenario
Anselm R. Garbe <arg@10kloc.org>
parents:
378
diff
changeset
|
7 |
382 | 8 static Client * |
480 | 9 nexttiled(Client *c) { |
10 for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); | |
11 return c; | |
12 } | |
13 | |
442 | 14 static void |
532
651f2c868b31
code polishing, removed unnecessary newlines
Anselm R. Garbe <arg@10kloc.org>
parents:
531
diff
changeset
|
15 togglemax(Client *c) { |
481 | 16 XEvent ev; |
548 | 17 |
549 | 18 if(c->isfixed) |
548 | 19 return; |
532
651f2c868b31
code polishing, removed unnecessary newlines
Anselm R. Garbe <arg@10kloc.org>
parents:
531
diff
changeset
|
20 |
480 | 21 if((c->ismax = !c->ismax)) { |
565 | 22 c->rx = c->x; c->x = wax; |
23 c->ry = c->y; c->y = way; | |
24 c->rw = c->w; c->w = waw - 2 * BORDERPX; | |
25 c->rh = c->h; c->h = wah - 2 * BORDERPX; | |
480 | 26 } |
27 else { | |
28 c->x = c->rx; | |
29 c->y = c->ry; | |
481 | 30 c->w = c->rw; |
31 c->h = c->rh; | |
480 | 32 } |
33 resize(c, True, TopLeft); | |
34 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
|
35 } |
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
|
36 |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
37 /* extern */ |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
38 |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
39 void (*arrange)(void) = DEFMODE; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
40 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
41 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
|
42 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
|
43 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
|
44 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
|
45 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
|
46 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
|
47 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
|
48 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
|
49 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
|
50 } |
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
|
51 |
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
|
52 void |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
53 dofloat(void) { |
402 | 54 Client *c; |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
397
diff
changeset
|
55 |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
56 for(c = clients; c; c = c->next) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
57 if(isvisible(c)) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
58 resize(c, True, TopLeft); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
59 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
60 else |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
61 ban(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
62 } |
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
|
63 if(!sel || !isvisible(sel)) { |
450
728c9089b079
applied sanders patch of not manipulating sel
Anselm R. Garbe <arg@10kloc.org>
parents:
446
diff
changeset
|
64 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
|
65 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
|
66 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
67 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
68 } |
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 |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
71 dotile(void) { |
565 | 72 unsigned int i, n, mpx, stackw, th; |
402 | 73 Client *c; |
400
052657ff2e7b
applied Sanders max_and_focus.patch
Anselm R. Garbe <arg@10kloc.org>
parents:
397
diff
changeset
|
74 |
488 | 75 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) |
76 n++; | |
565 | 77 mpx = (waw * master) / 1000; |
78 stackw = waw - mpx; | |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
79 |
535 | 80 for(i = 0, c = clients; c; c = c->next) |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
81 if(isvisible(c)) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
82 if(c->isfloat) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
83 resize(c, True, TopLeft); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
84 continue; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
85 } |
488 | 86 c->ismax = False; |
565 | 87 c->x = wax; |
88 c->y = way; | |
507 | 89 if(n == 1) { /* only 1 window */ |
565 | 90 c->w = waw - 2 * BORDERPX; |
91 c->h = wah - 2 * BORDERPX; | |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
92 } |
507 | 93 else if(i == 0) { /* master window */ |
587 | 94 c->w = mpx - 2 * BORDERPX; |
565 | 95 c->h = wah - 2 * BORDERPX; |
96 th = wah / (n - 1); | |
507 | 97 } |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
98 else { /* tile window */ |
531
96563762b4ad
yet another small fix and simplification of dotile
Anselm R. Garbe <arg@10kloc.org>
parents:
530
diff
changeset
|
99 c->x += mpx; |
96563762b4ad
yet another small fix and simplification of dotile
Anselm R. Garbe <arg@10kloc.org>
parents:
530
diff
changeset
|
100 c->w = stackw - 2 * BORDERPX; |
523
c1dd19da63ef
yet another simplification of dotile()
Anselm R. Garbe <arg@10kloc.org>
parents:
522
diff
changeset
|
101 if(th > bh) { |
588 | 102 c->y += (i - 1) * th; |
565 | 103 c->h = th - 2 * BORDERPX; |
507 | 104 } |
531
96563762b4ad
yet another small fix and simplification of dotile
Anselm R. Garbe <arg@10kloc.org>
parents:
530
diff
changeset
|
105 else /* fallback if th < bh */ |
565 | 106 c->h = wah - 2 * BORDERPX; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
107 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
108 resize(c, False, TopLeft); |
535 | 109 i++; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
110 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
111 else |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
112 ban(c); |
532
651f2c868b31
code polishing, removed unnecessary newlines
Anselm R. Garbe <arg@10kloc.org>
parents:
531
diff
changeset
|
113 |
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
|
114 if(!sel || !isvisible(sel)) { |
450
728c9089b079
applied sanders patch of not manipulating sel
Anselm R. Garbe <arg@10kloc.org>
parents:
446
diff
changeset
|
115 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
|
116 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
|
117 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
118 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
119 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
120 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
121 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
|
122 focusnext(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
123 Client *c; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
124 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
125 if(!sel) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
126 return; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
127 if(!(c = getnext(sel->next))) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
128 c = getnext(clients); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
129 if(c) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
130 focus(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
131 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
132 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
133 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
134 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
135 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
|
136 focusprev(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
137 Client *c; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
138 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
139 if(!sel) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
140 return; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
141 if(!(c = getprev(sel->prev))) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
142 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
|
143 c = getprev(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
144 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
145 if(c) { |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
146 focus(c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
147 restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
148 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
149 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
150 |
420 | 151 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
|
152 isvisible(Client *c) { |
420 | 153 unsigned int i; |
154 | |
155 for(i = 0; i < ntags; i++) | |
156 if(c->tags[i] && seltag[i]) | |
157 return True; | |
158 return False; | |
159 } | |
160 | |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
161 void |
559 | 162 resizemaster(Arg *arg) { |
561 | 163 if(arg->i == 0) |
164 master = MASTER; | |
165 else { | |
166 if(master + arg->i > 950 || master + arg->i < 50) | |
167 return; | |
168 master += arg->i; | |
169 } | |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
170 arrange(); |
415
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
171 } |
ad2b6ce6e95b
I really need column growing, now pushing upstream
Anselm R. Garbe <arg@10kloc.org>
parents:
414
diff
changeset
|
172 |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
173 void |
487 | 174 restack(void) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
175 Client *c; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
176 XEvent ev; |
481 | 177 |
437
433a5c662f73
drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents:
436
diff
changeset
|
178 if(!sel) { |
433a5c662f73
drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents:
436
diff
changeset
|
179 drawstatus(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
180 return; |
437
433a5c662f73
drawstatus even if no client exists
Anselm R. Garbe <arg@10kloc.org>
parents:
436
diff
changeset
|
181 } |
436
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
182 if(sel->isfloat || arrange == dofloat) { |
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
183 XRaiseWindow(dpy, sel->win); |
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
184 XRaiseWindow(dpy, sel->twin); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
185 } |
512
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
186 if(arrange != dofloat) { |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
187 if(!sel->isfloat) { |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
188 XLowerWindow(dpy, sel->twin); |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
189 XLowerWindow(dpy, sel->win); |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
190 } |
436
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
191 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
|
192 if(c == sel) |
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
193 continue; |
436
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
194 XLowerWindow(dpy, c->twin); |
b3659c3c5dab
sanders solution is convincing and elegant
Anselm R. Garbe <arg@10kloc.org>
parents:
433
diff
changeset
|
195 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
|
196 } |
512
aca04c3022c1
fixed the z-layer issue described on mailinglist
Anselm R. Garbe <arg@10kloc.org>
parents:
511
diff
changeset
|
197 } |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
198 drawall(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
199 XSync(dpy, False); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
200 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
201 } |
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 void |
584
37281ebc1b5b
added togglefloat to hg tip (i consider this useful for some cases), using MODKEY-Shift-space as shortcut
arg@mig29
parents:
573
diff
changeset
|
204 togglefloat(Arg *arg) { |
591
d9e9df9fdce6
togglefloat should only work in dotile mode (thanks to Sander for this hint)
arg@mig29
parents:
588
diff
changeset
|
205 if (!sel || arrange == dofloat) |
584
37281ebc1b5b
added togglefloat to hg tip (i consider this useful for some cases), using MODKEY-Shift-space as shortcut
arg@mig29
parents:
573
diff
changeset
|
206 return; |
37281ebc1b5b
added togglefloat to hg tip (i consider this useful for some cases), using MODKEY-Shift-space as shortcut
arg@mig29
parents:
573
diff
changeset
|
207 sel->isfloat = !sel->isfloat; |
37281ebc1b5b
added togglefloat to hg tip (i consider this useful for some cases), using MODKEY-Shift-space as shortcut
arg@mig29
parents:
573
diff
changeset
|
208 arrange(); |
37281ebc1b5b
added togglefloat to hg tip (i consider this useful for some cases), using MODKEY-Shift-space as shortcut
arg@mig29
parents:
573
diff
changeset
|
209 } |
37281ebc1b5b
added togglefloat to hg tip (i consider this useful for some cases), using MODKEY-Shift-space as shortcut
arg@mig29
parents:
573
diff
changeset
|
210 |
37281ebc1b5b
added togglefloat to hg tip (i consider this useful for some cases), using MODKEY-Shift-space as shortcut
arg@mig29
parents:
573
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 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
|
213 arrange = (arrange == dofloat) ? dotile : dofloat; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
214 if(sel) |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
215 arrange(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
216 else |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
217 drawstatus(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
218 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
219 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
220 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
|
221 toggleview(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
222 unsigned int i; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
223 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
224 seltag[arg->i] = !seltag[arg->i]; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
225 for(i = 0; i < ntags && !seltag[i]; i++); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
226 if(i == ntags) |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
227 seltag[arg->i] = True; /* cannot toggle last view */ |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
228 arrange(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
229 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
230 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
231 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
|
232 view(Arg *arg) { |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
233 unsigned int i; |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
234 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
235 for(i = 0; i < ntags; i++) |
594
f7dcd3ac8d6f
removed viewall(), replaced with view(-1); added tag(-1) to tag a client with all tags (new key combo MODKEY-Shift-0)
arg@mig29
parents:
591
diff
changeset
|
236 seltag[i] = (arg->i == -1) ? True : False; |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
237 seltag[arg->i] = True; |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
238 arrange(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
239 } |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
240 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
241 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
|
242 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
|
243 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
|
244 Client *c; |
473
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
245 |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
246 if(!sel) |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
247 return; |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
248 if(sel->isfloat || (arrange == dofloat)) { |
480 | 249 togglemax(sel); |
473
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
250 return; |
2d8af0d7920d
implemented the maximization as I described on the mailinglist, this feels better to me.
arg@mmvi
parents:
463
diff
changeset
|
251 } |
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
|
252 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
|
253 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
|
254 n++; |
486 | 255 if(n < 2 || (arrange == dofloat)) |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
256 return; |
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
|
257 if((c = sel) == nexttiled(clients)) |
433 | 258 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
|
259 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
|
260 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
|
261 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
|
262 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
|
263 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
|
264 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
|
265 focus(c); |
533
a5567a0d3011
do* has no Arg arument anymore (never called directly)
Anselm R. Garbe <arg@10kloc.org>
parents:
532
diff
changeset
|
266 arrange(); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
diff
changeset
|
267 } |