JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
renamed MASTER into MWFACT, master into mwfact, and incmaster into addtomwfact
[dwm.git] / float.c
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 }