diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 15:05:29 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-19 15:05:29 +0100 |
| commit | 238dd5d2b15b8bdc0f05d5be7f86a1ca03d2920b (patch) | |
| tree | 8f08ae0a2fe2a6e40aa0a263f6d19ada4291215b /screen.c | |
| parent | renamed manage.c to view.c (diff) | |
| download | dwm-238dd5d2b15b8bdc0f05d5be7f86a1ca03d2920b.tar.gz dwm-238dd5d2b15b8bdc0f05d5be7f86a1ca03d2920b.zip | |
renamed view.c into screen.c
Diffstat (limited to '')
| -rw-r--r-- | screen.c (renamed from view.c) | 51 |
1 files changed, 2 insertions, 49 deletions
| @@ -32,30 +32,6 @@ RULES | |||
| 32 | static Regexps *regexps = NULL; | 32 | static Regexps *regexps = NULL; |
| 33 | static unsigned int len = 0; | 33 | static unsigned int len = 0; |
| 34 | 34 | ||
| 35 | static Client * | ||
| 36 | nextmanaged(Client *c) { | ||
| 37 | for(; c && (c->isfloat || !isvisible(c)); c = c->next); | ||
| 38 | return c; | ||
| 39 | } | ||
| 40 | |||
| 41 | static void | ||
| 42 | togglemax(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 | ||
| 61 | void | 37 | void |
| @@ -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 | |||
| 323 | void | ||
| 324 | zoom(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 | } | ||
