author | Anselm R. Garbe <garbeam@gmail.com> |
Sat, 11 Aug 2007 14:44:11 +0200 | |
changeset 942 | f8295dc3d5e4 |
parent 941 | 8c93b982f22e |
permissions | -rw-r--r-- |
941
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
1 |
/* See LICENSE file for copyright and license details. */ |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
2 |
#include "dwm.h" |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
3 |
|
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
4 |
/* extern */ |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
5 |
|
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
6 |
void |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
7 |
floating(void) { |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
8 |
Client *c; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
9 |
|
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
10 |
if(lt->arrange != floating) |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
11 |
return; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
12 |
|
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
13 |
for(c = clients; c; c = c->next) |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
14 |
if(isvisible(c)) { |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
15 |
unban(c); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
16 |
resize(c, c->x, c->y, c->w, c->h, True); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
17 |
} |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
18 |
else |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
19 |
ban(c); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
20 |
focus(NULL); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
21 |
restack(); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
22 |
} |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
23 |
|
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
24 |
void |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
25 |
togglemax(const char *arg) { |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
26 |
XEvent ev; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
27 |
|
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
28 |
if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed) |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
29 |
return; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
30 |
if((sel->ismax = !sel->ismax)) { |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
31 |
sel->rx = sel->x; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
32 |
sel->ry = sel->y; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
33 |
sel->rw = sel->w; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
34 |
sel->rh = sel->h; |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
35 |
resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
36 |
} |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
37 |
else |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
38 |
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
39 |
drawstatus(); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
40 |
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |
8c93b982f22e
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
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff
changeset
|
41 |
} |