moved floating to layout.c, kept tile.c outside 0937cc78
Anselm R. Garbe · 2007-08-12 13:10 7 file(s) · +41 −50
config.arg.h +0 −1
25 25
26 26
/* layout(s) */
27 27
#include "tile.h"
28 -
#include "float.h"
29 28
#define LAYOUTS \
30 29
static Layout layout[] = { \
31 30
	/* symbol		function */ \
config.default.h +0 −1
26 26
27 27
/* layout(s) */
28 28
#include "tile.h"
29 -
#include "float.h"
30 29
#define LAYOUTS \
31 30
static Layout layout[] = { \
32 31
	/* symbol		function */ \
config.mk +2 −2
3 3
4 4
# Customize below to fit your system
5 5
6 -
# layouts
7 -
SRC = float.c tile.c
6 +
# additional layouts beside floating
7 +
SRC = tile.c
8 8
9 9
# paths
10 10
PREFIX = /usr/local
dwm.h +2 −0
120 120
void grabkeys(void);			/* grab all keys defined in config.h */
121 121
122 122
/* layout.c */
123 +
void floating(void);			/* arranges all windows floating, fallback layout  */
123 124
void focusclient(const char *arg);	/* focuses next(1)/previous(-1) visible client */
124 125
void initlayouts(void);			/* initialize layout array */
125 126
Client *nexttiled(Client *c);		/* returns tiled successor of c */
126 127
void restack(void);			/* restores z layers of all clients */
127 128
void setlayout(const char *arg);	/* sets layout, NULL means next layout */
128 129
void togglebar(const char *arg);	/* shows/hides the bar */
130 +
void togglemax(const char *arg);	/* toggles maximization of floating client */
129 131
130 132
/* main.c */
131 133
void updatebarpos(void);		/* updates the bar position */
float.c (deleted) +0 −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 -
}
float.h (deleted) +0 −5
1 -
/* See LICENSE file for copyright and license details. */
2 -
3 -
/* float.c */
4 -
void floating(void);			/* arranges all windows floating */
5 -
void togglemax(const char *arg);	/* toggles maximization of floating client */
layout.c +37 −0
14 14
/* extern */
15 15
16 16
void
17 +
floating(void) {
18 +
	Client *c;
19 +
20 +
	if(lt->arrange != floating)
21 +
		return;
22 +
23 +
	for(c = clients; c; c = c->next)
24 +
		if(isvisible(c)) {
25 +
			unban(c);
26 +
			resize(c, c->x, c->y, c->w, c->h, True);
27 +
		}
28 +
		else
29 +
			ban(c);
30 +
	focus(NULL);
31 +
	restack();
32 +
}
33 +
34 +
void
17 35
focusclient(const char *arg) {
18 36
	Client *c;
19 37
   
115 133
	updatebarpos();
116 134
	lt->arrange();
117 135
}
136 +
137 +
void
138 +
togglemax(const char *arg) {
139 +
	XEvent ev;
140 +
141 +
	if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed)
142 +
		return;
143 +
	if((sel->ismax = !sel->ismax)) {
144 +
		sel->rx = sel->x;
145 +
		sel->ry = sel->y;
146 +
		sel->rw = sel->w;
147 +
		sel->rh = sel->h;
148 +
		resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
149 +
	}
150 +
	else
151 +
		resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
152 +
	drawstatus();
153 +
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
154 +
}