summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--screen.c (renamed from view.c)51
1 files changed, 2 insertions, 49 deletions
diff --git a/view.c b/screen.c
index 34aae58..041cac7 100644
--- a/view.c
+++ b/screen.c
@@ -32,30 +32,6 @@ RULES
32static Regexps *regexps = NULL; 32static Regexps *regexps = NULL;
33static unsigned int len = 0; 33static unsigned int len = 0;
34 34
35static Client *
36nextmanaged(Client *c) {
37 for(; c && (c->isfloat || !isvisible(c)); c = c->next);
38 return c;
39}
40
41static void
42togglemax(Client *c) {
43 XEvent ev;
44
45 if(c->isfixed)
46 return;
47 if((c->ismax = !c->ismax)) {
48 c->rx = c->x;
49 c->ry = c->y;
50 c->rw = c->w;
51 c->rh = c->h;
52 resize(c, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True);
53 }
54 else
55 resize(c, c->rx, c->ry, c->rw, c->rh, True);
56 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
57}
58
59/* extern */ 35/* extern */
60 36
61void 37void
@@ -112,7 +88,7 @@ dotile(void) {
112 unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th; 88 unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
113 Client *c; 89 Client *c;
114 90
115 for(n = 0, c = nextmanaged(clients); c; c = nextmanaged(c->next)) 91 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
116 n++; 92 n++;
117 /* window geoms */ 93 /* window geoms */
118 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1); 94 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
@@ -209,7 +185,7 @@ restack(void) {
209 if(arrange != dofloat) { 185 if(arrange != dofloat) {
210 if(!sel->isfloat) 186 if(!sel->isfloat)
211 XLowerWindow(dpy, sel->win); 187 XLowerWindow(dpy, sel->win);
212 for(c = nextmanaged(clients); c; c = nextmanaged(c->next)) { 188 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
213 if(c == sel) 189 if(c == sel)
214 continue; 190 continue;
215 XLowerWindow(dpy, c->win); 191 XLowerWindow(dpy, c->win);
@@ -319,26 +295,3 @@ view(Arg *arg) {
319 seltag[arg->i] = True; 295 seltag[arg->i] = True;
320 arrange(); 296 arrange();
321} 297}
322
323void
324zoom(Arg *arg) {
325 unsigned int n;
326 Client *c;
327
328 if(!sel)
329 return;
330 if(sel->isfloat || (arrange == dofloat)) {
331 togglemax(sel);
332 return;
333 }
334 for(n = 0, c = nextmanaged(clients); c; c = nextmanaged(c->next))
335 n++;
336
337 if((c = sel) == nextmanaged(clients))
338 if(!(c = nextmanaged(c->next)))
339 return;
340 detach(c);
341 attach(c);
342 focus(c);
343 arrange();
344}