renamed untiled into floating, keeping tiled instead of tiling (afaik tiled sounds more correct) - English speakers convinced me 338c0838
Anselm R. Garbe · 2007-02-22 22:10 9 file(s) · +63 −63
client.c +5 −5
203 203
	updatetitle(c);
204 204
	for(t = clients; t && t->win != trans; t = t->next);
205 205
	settags(c, t);
206 -
	if(!c->isuntiled)
207 -
		c->isuntiled = (t != NULL) || c->isfixed;
206 +
	if(!c->isfloating)
207 +
		c->isfloating = (t != NULL) || c->isfixed;
208 208
	attach(c);
209 209
	attachstack(c);
210 210
	c->isbanned = True;
285 285
}
286 286
287 287
void
288 -
toggletiled(const char *arg) {
289 -
	if(!sel || lt->arrange == untile)
288 +
togglefloating(const char *arg) {
289 +
	if(!sel || lt->arrange == floating)
290 290
		return;
291 -
	sel->isuntiled = !sel->isuntiled;
291 +
	sel->isfloating = !sel->isfloating;
292 292
	lt->arrange();
293 293
}
294 294
config.arg.h +3 −3
18 18
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
19 19
#define RULES \
20 20
static Rule rule[] = { \
21 -
	/* class:instance:title regex	tags regex	isuntiled */ \
21 +
	/* class:instance:title regex	tags regex	isfloating */ \
22 22
	{ "Firefox",			"3",		False }, \
23 23
	{ "Gimp",			NULL,		True }, \
24 24
	{ "MPlayer",			NULL,		True }, \
30 30
static Layout layout[] = { \
31 31
	/* symbol		function */ \
32 32
	{ "[]=",		tile }, /* first entry is default */ \
33 -
	{ "><>",		untile }, \
33 +
	{ "><>",		floating }, \
34 34
};
35 35
#define MASTERWIDTH		600		/* master width per thousand */
36 36
#define NMASTER			1		/* clients in master area */
56 56
	{ MODKEY,			XK_k,		focusclient,	"-1" }, \
57 57
	{ MODKEY,			XK_m,		togglemax,	NULL }, \
58 58
	{ MODKEY,			XK_Return,	zoom,		NULL }, \
59 -
	{ MODKEY|ShiftMask,		XK_space,	toggletiled,	NULL }, \
59 +
	{ MODKEY|ShiftMask,		XK_space,	togglefloating,	NULL }, \
60 60
	{ MODKEY|ShiftMask,		XK_c,		killclient,	NULL }, \
61 61
	{ MODKEY,			XK_0,		view,		NULL }, \
62 62
	{ MODKEY,			XK_1,		view,		"0" }, \
config.default.h +3 −3
20 20
 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
21 21
#define RULES \
22 22
static Rule rule[] = { \
23 -
	/* class:instance:title regex	tags regex	isuntiled */ \
23 +
	/* class:instance:title regex	tags regex	isfloating */ \
24 24
	{ "Gimp",			NULL,		True }, \
25 25
	{ "MPlayer",			NULL,		True }, \
26 26
	{ "Acroread",			NULL,		True }, \
31 31
static Layout layout[] = { \
32 32
	/* symbol		function */ \
33 33
	{ "[]=",		tile }, /* first entry is default */ \
34 -
	{ "><>",		untile }, \
34 +
	{ "><>",		floating }, \
35 35
};
36 36
#define MASTERWIDTH		640		/* master width per thousand */
37 37
#define NMASTER			1		/* clients in master area */
52 52
	{ MODKEY|ShiftMask,		XK_Tab,		focusclient,	"-1" }, \
53 53
	{ MODKEY,			XK_m,		togglemax,	NULL }, \
54 54
	{ MODKEY,			XK_Return,	zoom,		NULL }, \
55 -
	{ MODKEY|ShiftMask,		XK_space,	toggletiled,	NULL }, \
55 +
	{ MODKEY|ShiftMask,		XK_space,	togglefloating,	NULL }, \
56 56
	{ MODKEY|ShiftMask,		XK_c,		killclient,	NULL }, \
57 57
	{ MODKEY,			XK_0,		view,		NULL }, \
58 58
	{ MODKEY,			XK_1,		view,		"0" }, \
draw.c +1 −1
81 81
		dc.x = x;
82 82
		if(sel) {
83 83
			drawtext(sel->name, dc.sel);
84 -
			drawsquare(sel->ismax, sel->isuntiled, dc.sel);
84 +
			drawsquare(sel->ismax, sel->isfloating, dc.sel);
85 85
		}
86 86
		else
87 87
			drawtext(NULL, dc.norm);
dwm.1 +11 −11
6 6
.RB [ \-v ]
7 7
.SH DESCRIPTION
8 8
dwm is a dynamic window manager for X. It manages windows in tiled and
9 -
untiled layouts. Either layout can be applied dynamically, optimizing the
9 +
floating layouts. Either layout can be applied dynamically, optimizing the
10 10
environment for the application in use and the task performed.
11 11
.P
12 12
In tiled layout windows are managed in a master and stacking area. The master
13 13
area contains the windows which currently need most attention, whereas the
14 -
stacking area contains all other windows. In untiled layout windows can be
15 -
resized and moved freely. Dialog windows are always managed untiled,
14 +
stacking area contains all other windows. In floating layout windows can be
15 +
resized and moved freely. Dialog windows are always managed floating,
16 16
regardless of the layout applied.
17 17
.P
18 18
Windows are grouped by tags. Each window can be tagged with one or multiple
20 20
.P
21 21
dwm contains a small status bar which displays all available tags, the layout,
22 22
the title of the focused window, and the text read from standard input. A
23 -
untiled window is indicated with an empty square and a maximized
24 -
untiled window is indicated with a filled square before the windows
23 +
floating window is indicated with an empty square and a maximized
24 +
floating window is indicated with a filled square before the windows
25 25
title.  The selected tags are indicated with a different color. The tags of
26 26
the focused window are indicated with a filled square in the top left
27 27
corner.  The tags which are applied to one or more windows are indicated
40 40
.TP
41 41
.B Button1
42 42
click on a tag label to display all windows with that tag, click on the layout
43 -
label toggles between tiled and untiled layout.
43 +
label toggles between tiled and floating layout.
44 44
.TP
45 45
.B Button3
46 46
click on a tag label adds/removes all windows with that tag to/from the view.
78 78
Decrease the number of windows in the master area (tiled layout only).
79 79
.TP
80 80
.B Mod1-m
81 -
Toggles maximization of current window (untiled layout only).
81 +
Toggles maximization of current window (floating layout only).
82 82
.TP
83 83
.B Mod1-Shift-[1..n]
84 84
Apply
97 97
Close focused window.
98 98
.TP
99 99
.B Mod1-space
100 -
Toggle between tiled and untiled layout (affects all windows).
100 +
Toggle between tiled and floating layout (affects all windows).
101 101
.TP
102 102
.B Mod1-Shift-space
103 -
Toggle focused window between tiled and untiled state (tiled layout only).
103 +
Toggle focused window between tiled and floating state (tiled layout only).
104 104
.TP
105 105
.B Mod1-[1..n]
106 106
View all windows with
120 120
.SS Mouse commands
121 121
.TP
122 122
.B Mod1-Button1
123 -
Move current window while dragging (untiled layout only).
123 +
Move current window while dragging (floating layout only).
124 124
.TP
125 125
.B Mod1-Button2
126 126
Zooms/cycles current window to/from master area (tiled layout only).
127 127
.TP
128 128
.B Mod1-Button3
129 -
Resize current window while dragging (untiled layout only).
129 +
Resize current window while dragging (floating layout only).
130 130
.SH CUSTOMIZATION
131 131
dwm is customized by creating a custom config.h and (re)compiling the source
132 132
code. This keeps it fast, secure and simple.
dwm.h +4 −4
50 50
	int minax, minay, maxax, maxay;
51 51
	long flags; 
52 52
	unsigned int border;
53 -
	Bool isbanned, isfixed, ismax, isuntiled;
53 +
	Bool isbanned, isfixed, ismax, isfloating;
54 54
	Bool *tags;
55 55
	Client *next;
56 56
	Client *prev;
103 103
extern void manage(Window w, XWindowAttributes *wa);	/* manage new client */
104 104
extern void resize(Client *c, int x, int y,
105 105
		int w, int h, Bool sizehints);	/* resize with given coordinates c*/
106 -
extern void toggletiled(const char *arg);	/* toggles focused client between tiled/untiled state */
106 +
extern void togglefloating(const char *arg);	/* toggles focused client between floating/tiled state */
107 107
extern void updatesizehints(Client *c);		/* update the size hint variables of c */
108 108
extern void updatetitle(Client *c);		/* update the name of c */
109 109
extern void unmanage(Client *c);		/* destroy c */
117 117
extern void grabkeys(void);			/* grab all keys defined in config.h */
118 118
119 119
/* layout.c */
120 +
extern void floating(void);			/* arranges all windows floating */
120 121
extern void focusclient(const char *arg);	/* focuses next(1)/previous(-1) visible client */
121 122
extern void incmasterw(const char *arg);	/* increments the master width with arg's index value */
122 123
extern void incnmaster(const char *arg);	/* increments nmaster with arg's index value */
124 125
extern Client *nexttiled(Client *c);		/* returns tiled successor of c */
125 126
extern void restack(void);			/* restores z layers of all clients */
126 127
extern void setlayout(const char *arg);		/* sets layout, -1 toggles */
127 -
extern void togglemax(const char *arg);		/* toggles maximization of untiled client */
128 -
extern void untile(void);			/* arranges all windows untiled */
128 +
extern void togglemax(const char *arg);		/* toggles maximization of floating client */
129 129
extern void zoom(const char *arg);		/* zooms the focused client to master area, arg is ignored */
130 130
131 131
/* main.c */
event.c +4 −4
151 151
		focus(c);
152 152
		if(CLEANMASK(ev->state) != MODKEY)
153 153
			return;
154 -
		if(ev->button == Button1 && (lt->arrange == untile || c->isuntiled)) {
154 +
		if(ev->button == Button1 && (lt->arrange == floating || c->isfloating)) {
155 155
			restack();
156 156
			movemouse(c);
157 157
		}
158 158
		else if(ev->button == Button2)
159 159
			zoom(NULL);
160 160
		else if(ev->button == Button3
161 -
		&& (lt->arrange == untile || c->isuntiled) && !c->isfixed)
161 +
		&& (lt->arrange == floating || c->isfloating) && !c->isfixed)
162 162
		{
163 163
			restack();
164 164
			resizemouse(c);
176 176
		c->ismax = False;
177 177
		if(ev->value_mask & CWBorderWidth)
178 178
			c->border = ev->border_width;
179 -
		if(c->isfixed || c->isuntiled || (lt->arrange == untile)) {
179 +
		if(c->isfixed || c->isfloating || (lt->arrange == floating)) {
180 180
			if(ev->value_mask & CWX)
181 181
				c->x = ev->x;
182 182
			if(ev->value_mask & CWY)
304 304
			default: break;
305 305
			case XA_WM_TRANSIENT_FOR:
306 306
				XGetTransientForHint(dpy, c->win, &trans);
307 -
				if(!c->isuntiled && (c->isuntiled = (getclient(trans) != NULL)))
307 +
				if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL)))
308 308
					lt->arrange();
309 309
				break;
310 310
			case XA_WM_NORMAL_HINTS:
layout.c +30 −30
31 31
			if(c->isbanned)
32 32
				XMoveWindow(dpy, c->win, c->x, c->y);
33 33
			c->isbanned = False;
34 -
			if(c->isuntiled)
34 +
			if(c->isfloating)
35 35
				continue;
36 36
			c->ismax = False;
37 37
			nx = wax;
68 68
LAYOUTS
69 69
70 70
/* extern */
71 +
72 +
void
73 +
floating(void) {
74 +
	Client *c;
75 +
76 +
	for(c = clients; c; c = c->next) {
77 +
		if(isvisible(c)) {
78 +
			if(c->isbanned)
79 +
				XMoveWindow(dpy, c->win, c->x, c->y);
80 +
			c->isbanned = False;
81 +
			resize(c, c->x, c->y, c->w, c->h, True);
82 +
		}
83 +
		else {
84 +
			c->isbanned = True;
85 +
			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
86 +
		}
87 +
	}
88 +
	if(!sel || !isvisible(sel)) {
89 +
		for(c = stack; c && !isvisible(c); c = c->snext);
90 +
		focus(c);
91 +
	}
92 +
	restack();
93 +
}
71 94
72 95
void
73 96
focusclient(const char *arg) {
144 167
145 168
Client *
146 169
nexttiled(Client *c) {
147 -
	for(; c && (c->isuntiled || !isvisible(c)); c = c->next);
170 +
	for(; c && (c->isfloating || !isvisible(c)); c = c->next);
148 171
	return c;
149 172
}
150 173
156 179
	drawstatus();
157 180
	if(!sel)
158 181
		return;
159 -
	if(sel->isuntiled || lt->arrange == untile)
182 +
	if(sel->isfloating || lt->arrange == floating)
160 183
		XRaiseWindow(dpy, sel->win);
161 -
	if(lt->arrange != untile) {
162 -
		if(!sel->isuntiled)
184 +
	if(lt->arrange != floating) {
185 +
		if(!sel->isfloating)
163 186
			XLowerWindow(dpy, sel->win);
164 187
		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
165 188
			if(c == sel)
198 221
togglemax(const char *arg) {
199 222
	XEvent ev;
200 223
201 -
	if(!sel || (lt->arrange != untile && !sel->isuntiled) || sel->isfixed)
224 +
	if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed)
202 225
		return;
203 226
	if((sel->ismax = !sel->ismax)) {
204 227
		sel->rx = sel->x;
214 237
}
215 238
216 239
void
217 -
untile(void) {
218 -
	Client *c;
219 -
220 -
	for(c = clients; c; c = c->next) {
221 -
		if(isvisible(c)) {
222 -
			if(c->isbanned)
223 -
				XMoveWindow(dpy, c->win, c->x, c->y);
224 -
			c->isbanned = False;
225 -
			resize(c, c->x, c->y, c->w, c->h, True);
226 -
		}
227 -
		else {
228 -
			c->isbanned = True;
229 -
			XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
230 -
		}
231 -
	}
232 -
	if(!sel || !isvisible(sel)) {
233 -
		for(c = stack; c && !isvisible(c); c = c->snext);
234 -
		focus(c);
235 -
	}
236 -
	restack();
237 -
}
238 -
239 -
void
240 240
zoom(const char *arg) {
241 241
	unsigned int n;
242 242
	Client *c;
243 243
244 -
	if(!sel || lt->arrange != tile || sel->isuntiled)
244 +
	if(!sel || lt->arrange != tile || sel->isfloating)
245 245
		return;
246 246
	for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
247 247
		n++;
tag.c +2 −2
12 12
typedef struct {
13 13
	const char *prop;
14 14
	const char *tags;
15 -
	Bool isuntiled;
15 +
	Bool isfloating;
16 16
} Rule;
17 17
18 18
typedef struct {
83 83
				ch.res_name ? ch.res_name : "", c->name);
84 84
		for(i = 0; i < nrules; i++)
85 85
			if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
86 -
				c->isuntiled = rule[i].isuntiled;
86 +
				c->isfloating = rule[i].isfloating;
87 87
				for(j = 0; regs[i].tagregex && j < ntags; j++) {
88 88
					if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
89 89
						matched = True;