diff options
| author | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-11 12:11:50 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@gmail.com> | 2007-08-11 12:11:50 +0200 |
| commit | 2d81b78b853565a3e34a8a9190e2362a6fdde739 (patch) | |
| tree | d58d24853f77685588e42f73a01d782980a3b95e /float.c | |
| parent | let not overlap the borders (diff) | |
| download | dwm-2d81b78b853565a3e34a8a9190e2362a6fdde739.tar.gz dwm-2d81b78b853565a3e34a8a9190e2362a6fdde739.zip | |
separated layout-specific stuff into separate .h and .c files which are included in config.h resp. config.mk - this allows writing layouts for dwm without any need to patch existing code
Diffstat (limited to 'float.c')
| -rw-r--r-- | float.c | 41 |
1 files changed, 41 insertions, 0 deletions
| @@ -0,0 +1,41 @@ | |||
| 1 | /* See LICENSE file for copyright and license details. */ | ||
| 2 | #include "dwm.h" | ||
| 3 | |||
| 4 | /* extern */ | ||
| 5 | |||
| 6 | void | ||
| 7 | floating(void) { | ||
| 8 | Client *c; | ||
| 9 | |||
| 10 | if(lt->arrange != floating) | ||
| 11 | return; | ||
| 12 | |||
| 13 | for(c = clients; c; c = c->next) | ||
| 14 | if(isvisible(c)) { | ||
| 15 | unban(c); | ||
| 16 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 17 | } | ||
| 18 | else | ||
| 19 | ban(c); | ||
| 20 | focus(NULL); | ||
| 21 | restack(); | ||
| 22 | } | ||
| 23 | |||
| 24 | void | ||
| 25 | togglemax(const char *arg) { | ||
| 26 | XEvent ev; | ||
| 27 | |||
| 28 | if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed) | ||
| 29 | return; | ||
| 30 | if((sel->ismax = !sel->ismax)) { | ||
| 31 | sel->rx = sel->x; | ||
| 32 | sel->ry = sel->y; | ||
| 33 | sel->rw = sel->w; | ||
| 34 | sel->rh = sel->h; | ||
| 35 | resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True); | ||
| 36 | } | ||
| 37 | else | ||
| 38 | resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); | ||
| 39 | drawstatus(); | ||
| 40 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | ||
| 41 | } | ||
