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 | b5eea45a316a897632578a74c909aa336557b1d6 (diff) |
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
diff --git a/float.c b/float.c new file mode 100644 index 00000000..25bec69d --- /dev/null +++ b/float.c @@ -0,0 +1,41 @@ +/* See LICENSE file for copyright and license details. */ +#include "dwm.h" + +/* extern */ + +void +floating(void) { + Client *c; + + if(lt->arrange != floating) + return; + + for(c = clients; c; c = c->next) + if(isvisible(c)) { + unban(c); + resize(c, c->x, c->y, c->w, c->h, True); + } + else + ban(c); + focus(NULL); + restack(); +} + +void +togglemax(const char *arg) { + XEvent ev; + + if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed) + return; + if((sel->ismax = !sel->ismax)) { + sel->rx = sel->x; + sel->ry = sel->y; + sel->rw = sel->w; + sel->rh = sel->h; + resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True); + } + else + resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); + drawstatus(); + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); +} |