made all stuff non-static - so you can choose wether to use dwm the static or the extern way when extending it fe2775a1
arg@suckless.org · 2007-09-17 16:42 4 file(s) · +184 −187
Makefile +1 −1
3 3
4 4
include config.mk
5 5
6 -
SRC = dwm.c
6 +
SRC += dwm.c
7 7
OBJ = ${SRC:.c=.o}
8 8
9 9
all: options dwm
config.h +3 −3
12 12
#define SELFGCOLOR		"#fff"
13 13
14 14
/* tagging */
15 -
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
16 -
static Rule rules[] = {
15 +
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
16 +
Rule rules[] = {
17 17
	/* class:instance:title regex	tags regex	isfloating */
18 18
	{ "Firefox",			"3",		False },
19 19
	{ "Gimp",			NULL,		True },
22 22
};
23 23
24 24
/* layout(s) */
25 -
static Layout layouts[] = {
25 +
Layout layouts[] = {
26 26
	/* symbol		function */
27 27
	{ "[]=",		tile }, /* first entry is default */
28 28
	{ "><>",		floating },
dwm.1 +1 −1
1 -
.TH DWM 1 dwm\-VERSION
1 +
.TH DWM 1 dwm\-4.3
2 2
.SH NAME
3 3
dwm \- dynamic window manager
4 4
.SH SYNOPSIS
dwm.c +179 −182
21 21
 * creates a small title window, which is resized whenever the (_NET_)WM_NAME
22 22
 * properties are updated or the client is moved/resized.
23 23
 *
24 -
 * Keys and tagging rules are organized as arrays and defined in the config.h
25 -
 * file. These arrays are kept static in event.o and tag.o respectively,
26 -
 * because no other part of dwm needs access to them.  The current layout is
27 -
 * represented by the lt pointer.
24 +
 * Keys and tagging rules are organized as arrays and defined in config.h.
28 25
 *
29 26
 * To understand everything else, start reading main().
30 27
 */
114 111
} Regs;
115 112
116 113
/* forward declarations */
117 -
static void applyrules(Client *c);
118 -
static void arrange(void);
119 -
static void attach(Client *c);
120 -
static void attachstack(Client *c);
121 -
static void ban(Client *c);
122 -
static void buttonpress(XEvent *e);
123 -
static void checkotherwm(void);
124 -
static void cleanup(void);
125 -
static void compileregs(void);
126 -
static void configure(Client *c);
127 -
static void configurenotify(XEvent *e);
128 -
static void configurerequest(XEvent *e);
129 -
static void destroynotify(XEvent *e);
130 -
static void detach(Client *c);
131 -
static void detachstack(Client *c);
132 -
static void drawbar(void);
133 -
static void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
134 -
static void drawtext(const char *text, unsigned long col[ColLast]);
135 -
static void *emallocz(unsigned int size);
136 -
static void enternotify(XEvent *e);
137 -
static void eprint(const char *errstr, ...);
138 -
static void expose(XEvent *e);
139 -
static void floating(void); /* default floating layout */
140 -
static void focus(Client *c);
141 -
static void focusnext(const char *arg);
142 -
static void focusprev(const char *arg);
143 -
static Client *getclient(Window w);
144 -
static unsigned long getcolor(const char *colstr);
145 -
static long getstate(Window w);
146 -
static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
147 -
static void grabbuttons(Client *c, Bool focused);
148 -
static unsigned int idxoftag(const char *tag);
149 -
static void initfont(const char *fontstr);
150 -
static Bool isarrange(void (*func)());
151 -
static Bool isoccupied(unsigned int t);
152 -
static Bool isprotodel(Client *c);
153 -
static Bool isvisible(Client *c);
154 -
static void keypress(XEvent *e);
155 -
static void killclient(const char *arg);
156 -
static void leavenotify(XEvent *e);
157 -
static void manage(Window w, XWindowAttributes *wa);
158 -
static void mappingnotify(XEvent *e);
159 -
static void maprequest(XEvent *e);
160 -
static void movemouse(Client *c);
161 -
static Client *nexttiled(Client *c);
162 -
static void propertynotify(XEvent *e);
163 -
static void quit(const char *arg);
164 -
static void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
165 -
static void resizemouse(Client *c);
166 -
static void restack(void);
167 -
static void run(void);
168 -
static void scan(void);
169 -
static void setclientstate(Client *c, long state);
170 -
static void setlayout(const char *arg);
171 -
static void setmwfact(const char *arg);
172 -
static void setup(void);
173 -
static void spawn(const char *arg);
174 -
static void tag(const char *arg);
175 -
static unsigned int textnw(const char *text, unsigned int len);
176 -
static unsigned int textw(const char *text);
177 -
static void tile(void);
178 -
static void togglebar(const char *arg);
179 -
static void togglefloating(const char *arg);
180 -
static void togglemax(const char *arg);
181 -
static void toggletag(const char *arg);
182 -
static void toggleview(const char *arg);
183 -
static void unban(Client *c);
184 -
static void unmanage(Client *c);
185 -
static void unmapnotify(XEvent *e);
186 -
static void updatebarpos(void);
187 -
static void updatesizehints(Client *c);
188 -
static void updatetitle(Client *c);
189 -
static void view(const char *arg);
190 -
static int xerror(Display *dpy, XErrorEvent *ee);
191 -
static int xerrordummy(Display *dsply, XErrorEvent *ee);
192 -
static int xerrorstart(Display *dsply, XErrorEvent *ee);
193 -
static void zoom(const char *arg);
114 +
void applyrules(Client *c);
115 +
void arrange(void);
116 +
void attach(Client *c);
117 +
void attachstack(Client *c);
118 +
void ban(Client *c);
119 +
void buttonpress(XEvent *e);
120 +
void checkotherwm(void);
121 +
void cleanup(void);
122 +
void compileregs(void);
123 +
void configure(Client *c);
124 +
void configurenotify(XEvent *e);
125 +
void configurerequest(XEvent *e);
126 +
void destroynotify(XEvent *e);
127 +
void detach(Client *c);
128 +
void detachstack(Client *c);
129 +
void drawbar(void);
130 +
void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
131 +
void drawtext(const char *text, unsigned long col[ColLast]);
132 +
void *emallocz(unsigned int size);
133 +
void enternotify(XEvent *e);
134 +
void eprint(const char *errstr, ...);
135 +
void expose(XEvent *e);
136 +
void floating(void); /* default floating layout */
137 +
void focus(Client *c);
138 +
void focusnext(const char *arg);
139 +
void focusprev(const char *arg);
140 +
Client *getclient(Window w);
141 +
unsigned long getcolor(const char *colstr);
142 +
long getstate(Window w);
143 +
Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
144 +
void grabbuttons(Client *c, Bool focused);
145 +
unsigned int idxoftag(const char *tag);
146 +
void initfont(const char *fontstr);
147 +
Bool isarrange(void (*func)());
148 +
Bool isoccupied(unsigned int t);
149 +
Bool isprotodel(Client *c);
150 +
Bool isvisible(Client *c);
151 +
void keypress(XEvent *e);
152 +
void killclient(const char *arg);
153 +
void leavenotify(XEvent *e);
154 +
void manage(Window w, XWindowAttributes *wa);
155 +
void mappingnotify(XEvent *e);
156 +
void maprequest(XEvent *e);
157 +
void movemouse(Client *c);
158 +
Client *nexttiled(Client *c);
159 +
void propertynotify(XEvent *e);
160 +
void quit(const char *arg);
161 +
void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
162 +
void resizemouse(Client *c);
163 +
void restack(void);
164 +
void run(void);
165 +
void scan(void);
166 +
void setclientstate(Client *c, long state);
167 +
void setlayout(const char *arg);
168 +
void setmwfact(const char *arg);
169 +
void setup(void);
170 +
void spawn(const char *arg);
171 +
void tag(const char *arg);
172 +
unsigned int textnw(const char *text, unsigned int len);
173 +
unsigned int textw(const char *text);
174 +
void tile(void);
175 +
void togglebar(const char *arg);
176 +
void togglefloating(const char *arg);
177 +
void togglemax(const char *arg);
178 +
void toggletag(const char *arg);
179 +
void toggleview(const char *arg);
180 +
void unban(Client *c);
181 +
void unmanage(Client *c);
182 +
void unmapnotify(XEvent *e);
183 +
void updatebarpos(void);
184 +
void updatesizehints(Client *c);
185 +
void updatetitle(Client *c);
186 +
void view(const char *arg);
187 +
int xerror(Display *dpy, XErrorEvent *ee);
188 +
int xerrordummy(Display *dsply, XErrorEvent *ee);
189 +
int xerrorstart(Display *dsply, XErrorEvent *ee);
190 +
void zoom(const char *arg);
194 191
195 192
/* variables */
196 -
static char stext[256];
197 -
static double mwfact;
198 -
static int screen, sx, sy, sw, sh, wax, way, waw, wah;
199 -
static int (*xerrorxlib)(Display *, XErrorEvent *);
200 -
static unsigned int bh, bpos, ntags;
201 -
static unsigned int blw = 0;
202 -
static unsigned int ltidx = 0; /* default */
203 -
static unsigned int nlayouts = 0;
204 -
static unsigned int nrules = 0;
205 -
static unsigned int numlockmask = 0;
206 -
static void (*handler[LASTEvent]) (XEvent *) = {
193 +
char stext[256];
194 +
double mwfact;
195 +
int screen, sx, sy, sw, sh, wax, way, waw, wah;
196 +
int (*xerrorxlib)(Display *, XErrorEvent *);
197 +
unsigned int bh, bpos, ntags;
198 +
unsigned int blw = 0;
199 +
unsigned int ltidx = 0; /* default */
200 +
unsigned int nlayouts = 0;
201 +
unsigned int nrules = 0;
202 +
unsigned int numlockmask = 0;
203 +
void (*handler[LASTEvent]) (XEvent *) = {
207 204
	[ButtonPress] = buttonpress,
208 205
	[ConfigureRequest] = configurerequest,
209 206
	[ConfigureNotify] = configurenotify,
217 214
	[PropertyNotify] = propertynotify,
218 215
	[UnmapNotify] = unmapnotify
219 216
};
220 -
static Atom wmatom[WMLast], netatom[NetLast];
221 -
static Bool otherwm, readin;
222 -
static Bool running = True;
223 -
static Bool *seltags;
224 -
static Bool selscreen = True;
225 -
static Client *clients = NULL;
226 -
static Client *sel = NULL;
227 -
static Client *stack = NULL;
228 -
static Cursor cursor[CurLast];
229 -
static Display *dpy;
230 -
static DC dc = {0};
231 -
static Window barwin, root;
232 -
static Regs *regs = NULL;
217 +
Atom wmatom[WMLast], netatom[NetLast];
218 +
Bool otherwm, readin;
219 +
Bool running = True;
220 +
Bool *seltags;
221 +
Bool selscreen = True;
222 +
Client *clients = NULL;
223 +
Client *sel = NULL;
224 +
Client *stack = NULL;
225 +
Cursor cursor[CurLast];
226 +
Display *dpy;
227 +
DC dc = {0};
228 +
Window barwin, root;
229 +
Regs *regs = NULL;
233 230
234 231
/* configuration, allows nested code to access above variables */
235 232
#include "config.h"
236 233
237 234
/* functions*/
238 -
static void
235 +
void
239 236
applyrules(Client *c) {
240 237
	static char buf[512];
241 238
	unsigned int i, j;
267 264
			c->tags[i] = seltags[i];
268 265
}
269 266
270 -
static void
267 +
void
271 268
arrange(void) {
272 269
	Client *c;
273 270
281 278
	restack();
282 279
}
283 280
284 -
static void
281 +
void
285 282
attach(Client *c) {
286 283
	if(clients)
287 284
		clients->prev = c;
289 286
	clients = c;
290 287
}
291 288
292 -
static void
289 +
void
293 290
attachstack(Client *c) {
294 291
	c->snext = stack;
295 292
	stack = c;
296 293
}
297 294
298 -
static void
295 +
void
299 296
ban(Client *c) {
300 297
	if(c->isbanned)
301 298
		return;
303 300
	c->isbanned = True;
304 301
}
305 302
306 -
static void
303 +
void
307 304
buttonpress(XEvent *e) {
308 305
	unsigned int i, x;
309 306
	Client *c;
359 356
	}
360 357
}
361 358
362 -
static void
359 +
void
363 360
checkotherwm(void) {
364 361
	otherwm = False;
365 362
	XSetErrorHandler(xerrorstart);
375 372
	XSync(dpy, False);
376 373
}
377 374
378 -
static void
375 +
void
379 376
cleanup(void) {
380 377
	close(STDIN_FILENO);
381 378
	while(stack) {
398 395
	free(seltags);
399 396
}
400 397
401 -
static void
398 +
void
402 399
compileregs(void) {
403 400
	unsigned int i;
404 401
	regex_t *reg;
425 422
	}
426 423
}
427 424
428 -
static void
425 +
void
429 426
configure(Client *c) {
430 427
	XConfigureEvent ce;
431 428
443 440
	XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
444 441
}
445 442
446 -
static void
443 +
void
447 444
configurenotify(XEvent *e) {
448 445
	XConfigureEvent *ev = &e->xconfigure;
449 446
458 455
	}
459 456
}
460 457
461 -
static void
458 +
void
462 459
configurerequest(XEvent *e) {
463 460
	Client *c;
464 461
	XConfigureRequestEvent *ev = &e->xconfigurerequest;
503 500
	XSync(dpy, False);
504 501
}
505 502
506 -
static void
503 +
void
507 504
destroynotify(XEvent *e) {
508 505
	Client *c;
509 506
	XDestroyWindowEvent *ev = &e->xdestroywindow;
512 509
		unmanage(c);
513 510
}
514 511
515 -
static void
512 +
void
516 513
detach(Client *c) {
517 514
	if(c->prev)
518 515
		c->prev->next = c->next;
523 520
	c->next = c->prev = NULL;
524 521
}
525 522
526 -
static void
523 +
void
527 524
detachstack(Client *c) {
528 525
	Client **tc;
529 526
531 528
	*tc = c->snext;
532 529
}
533 530
534 -
static void
531 +
void
535 532
drawbar(void) {
536 533
	int i, x;
537 534
571 568
	XSync(dpy, False);
572 569
}
573 570
574 -
static void
571 +
void
575 572
drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
576 573
	int x;
577 574
	XGCValues gcv;
592 589
	}
593 590
}
594 591
595 -
static void
592 +
void
596 593
drawtext(const char *text, unsigned long col[ColLast]) {
597 594
	int x, y, w, h;
598 595
	static char buf[256];
632 629
		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
633 630
}
634 631
635 -
static void *
632 +
void *
636 633
emallocz(unsigned int size) {
637 634
	void *res = calloc(1, size);
638 635
641 638
	return res;
642 639
}
643 640
644 -
static void
641 +
void
645 642
enternotify(XEvent *e) {
646 643
	Client *c;
647 644
	XCrossingEvent *ev = &e->xcrossing;
656 653
	}
657 654
}
658 655
659 -
static void
656 +
void
660 657
eprint(const char *errstr, ...) {
661 658
	va_list ap;
662 659
666 663
	exit(EXIT_FAILURE);
667 664
}
668 665
669 -
static void
666 +
void
670 667
expose(XEvent *e) {
671 668
	XExposeEvent *ev = &e->xexpose;
672 669
676 673
	}
677 674
}
678 675
679 -
static void
676 +
void
680 677
floating(void) { /* default floating layout */
681 678
	Client *c;
682 679
685 682
			resize(c, c->x, c->y, c->w, c->h, True);
686 683
}
687 684
688 -
static void
685 +
void
689 686
focus(Client *c) {
690 687
	if((!c && selscreen) || (c && !isvisible(c)))
691 688
		for(c = stack; c && !isvisible(c); c = c->snext);
710 707
		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
711 708
}
712 709
713 -
static void
710 +
void
714 711
focusnext(const char *arg) {
715 712
	Client *c;
716 713
725 722
	}
726 723
}
727 724
728 -
static void
725 +
void
729 726
focusprev(const char *arg) {
730 727
	Client *c;
731 728
742 739
	}
743 740
}
744 741
745 -
static Client *
742 +
Client *
746 743
getclient(Window w) {
747 744
	Client *c;
748 745
750 747
	return c;
751 748
}
752 749
753 -
static unsigned long
750 +
unsigned long
754 751
getcolor(const char *colstr) {
755 752
	Colormap cmap = DefaultColormap(dpy, screen);
756 753
	XColor color;
760 757
	return color.pixel;
761 758
}
762 759
763 -
static long
760 +
long
764 761
getstate(Window w) {
765 762
	int format, status;
766 763
	long result = -1;
778 775
	return result;
779 776
}
780 777
781 -
static Bool
778 +
Bool
782 779
gettextprop(Window w, Atom atom, char *text, unsigned int size) {
783 780
	char **list = NULL;
784 781
	int n;
805 802
	return True;
806 803
}
807 804
808 -
static void
805 +
void
809 806
grabbuttons(Client *c, Bool focused) {
810 807
	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
811 808
842 839
				GrabModeAsync, GrabModeSync, None, None);
843 840
}
844 841
845 -
static unsigned int
842 +
unsigned int
846 843
idxoftag(const char *tag) {
847 844
	unsigned int i;
848 845
852 849
	return 0;
853 850
}
854 851
855 -
static void
852 +
void
856 853
initfont(const char *fontstr) {
857 854
	char *def, **missing;
858 855
	int i, n;
894 891
	dc.font.height = dc.font.ascent + dc.font.descent;
895 892
}
896 893
897 -
static Bool
894 +
Bool
898 895
isarrange(void (*func)())
899 896
{
900 897
	return func == layouts[ltidx].arrange;
901 898
}
902 899
903 -
static Bool
900 +
Bool
904 901
isoccupied(unsigned int t) {
905 902
	Client *c;
906 903
910 907
	return False;
911 908
}
912 909
913 -
static Bool
910 +
Bool
914 911
isprotodel(Client *c) {
915 912
	int i, n;
916 913
	Atom *protocols;
925 922
	return ret;
926 923
}
927 924
928 -
static Bool
925 +
Bool
929 926
isvisible(Client *c) {
930 927
	unsigned int i;
931 928
935 932
	return False;
936 933
}
937 934
938 -
static void
935 +
void
939 936
keypress(XEvent *e) {
940 937
	KEYS
941 938
	unsigned int len = sizeof keys / sizeof keys[0];
970 967
		}
971 968
}
972 969
973 -
static void
970 +
void
974 971
killclient(const char *arg) {
975 972
	XEvent ev;
976 973
989 986
		XKillClient(dpy, sel->win);
990 987
}
991 988
992 -
static void
989 +
void
993 990
leavenotify(XEvent *e) {
994 991
	XCrossingEvent *ev = &e->xcrossing;
995 992
999 996
	}
1000 997
}
1001 998
1002 -
static void
999 +
void
1003 1000
manage(Window w, XWindowAttributes *wa) {
1004 1001
	unsigned int i;
1005 1002
	Client *c, *t = NULL;
1057 1054
	arrange();
1058 1055
}
1059 1056
1060 -
static void
1057 +
void
1061 1058
mappingnotify(XEvent *e) {
1062 1059
	XMappingEvent *ev = &e->xmapping;
1063 1060
1066 1063
		keypress(NULL);
1067 1064
}
1068 1065
1069 -
static void
1066 +
void
1070 1067
maprequest(XEvent *e) {
1071 1068
	static XWindowAttributes wa;
1072 1069
	XMapRequestEvent *ev = &e->xmaprequest;
1079 1076
		manage(ev->window, &wa);
1080 1077
}
1081 1078
1082 -
static void
1079 +
void
1083 1080
movemouse(Client *c) {
1084 1081
	int x1, y1, ocx, ocy, di, nx, ny;
1085 1082
	unsigned int dui;
1122 1119
	}
1123 1120
}
1124 1121
1125 -
static Client *
1122 +
Client *
1126 1123
nexttiled(Client *c) {
1127 1124
	for(; c && (c->isfloating || !isvisible(c)); c = c->next);
1128 1125
	return c;
1129 1126
}
1130 1127
1131 -
static void
1128 +
void
1132 1129
propertynotify(XEvent *e) {
1133 1130
	Client *c;
1134 1131
	Window trans;
1156 1153
	}
1157 1154
}
1158 1155
1159 -
static void
1156 +
void
1160 1157
quit(const char *arg) {
1161 1158
	readin = running = False;
1162 1159
}
1163 1160
1164 -
static void
1161 +
void
1165 1162
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
1166 1163
	double dx, dy, max, min, ratio;
1167 1164
	XWindowChanges wc; 
1224 1221
	}
1225 1222
}
1226 1223
1227 -
static void
1224 +
void
1228 1225
resizemouse(Client *c) {
1229 1226
	int ocx, ocy;
1230 1227
	int nw, nh;
1263 1260
	}
1264 1261
}
1265 1262
1266 -
static void
1263 +
void
1267 1264
restack(void) {
1268 1265
	Client *c;
1269 1266
	XEvent ev;
1292 1289
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
1293 1290
}
1294 1291
1295 -
static void
1292 +
void
1296 1293
run(void) {
1297 1294
	char *p;
1298 1295
	int r, xfd;
1340 1337
	}
1341 1338
}
1342 1339
1343 -
static void
1340 +
void
1344 1341
scan(void) {
1345 1342
	unsigned int i, num;
1346 1343
	Window *wins, d1, d2;
1367 1364
		XFree(wins);
1368 1365
}
1369 1366
1370 -
static void
1367 +
void
1371 1368
setclientstate(Client *c, long state) {
1372 1369
	long data[] = {state, None};
1373 1370
1375 1372
			PropModeReplace, (unsigned char *)data, 2);
1376 1373
}
1377 1374
1378 -
static void
1375 +
void
1379 1376
setlayout(const char *arg) {
1380 1377
	unsigned int i;
1381 1378
1397 1394
		drawbar();
1398 1395
}
1399 1396
1400 -
static void
1397 +
void
1401 1398
setmwfact(const char *arg) {
1402 1399
	double delta;
1403 1400
1419 1416
	arrange();
1420 1417
}
1421 1418
1422 -
static void
1419 +
void
1423 1420
setup(void) {
1424 1421
	unsigned int i, j, mask;
1425 1422
	Window w;
1513 1510
	selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
1514 1511
}
1515 1512
1516 -
static void
1513 +
void
1517 1514
spawn(const char *arg) {
1518 1515
	static char *shell = NULL;
1519 1516
1537 1534
	wait(0);
1538 1535
}
1539 1536
1540 -
static void
1537 +
void
1541 1538
tag(const char *arg) {
1542 1539
	unsigned int i;
1543 1540
1551 1548
	arrange();
1552 1549
}
1553 1550
1554 -
static unsigned int
1551 +
unsigned int
1555 1552
textnw(const char *text, unsigned int len) {
1556 1553
	XRectangle r;
1557 1554
1562 1559
	return XTextWidth(dc.font.xfont, text, len);
1563 1560
}
1564 1561
1565 -
static unsigned int
1562 +
unsigned int
1566 1563
textw(const char *text) {
1567 1564
	return textnw(text, strlen(text)) + dc.font.height;
1568 1565
}
1569 1566
1570 -
static void
1567 +
void
1571 1568
tile(void) {
1572 1569
	unsigned int i, n, nx, ny, nw, nh, mw, th;
1573 1570
	Client *c;
1606 1603
	}
1607 1604
}
1608 1605
1609 -
static void
1606 +
void
1610 1607
togglebar(const char *arg) {
1611 1608
	if(bpos == BarOff)
1612 1609
		bpos = (BARPOS == BarOff) ? BarTop : BARPOS;
1616 1613
	arrange();
1617 1614
}
1618 1615
1619 -
static void
1616 +
void
1620 1617
togglefloating(const char *arg) {
1621 1618
	if(!sel)
1622 1619
		return;
1626 1623
	arrange();
1627 1624
}
1628 1625
1629 -
static void
1626 +
void
1630 1627
togglemax(const char *arg) {
1631 1628
	XEvent ev;
1632 1629
1645 1642
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
1646 1643
}
1647 1644
1648 -
static void
1645 +
void
1649 1646
toggletag(const char *arg) {
1650 1647
	unsigned int i, j;
1651 1648
1659 1656
	arrange();
1660 1657
}
1661 1658
1662 -
static void
1659 +
void
1663 1660
toggleview(const char *arg) {
1664 1661
	unsigned int i, j;
1665 1662
1671 1668
	arrange();
1672 1669
}
1673 1670
1674 -
static void
1671 +
void
1675 1672
unban(Client *c) {
1676 1673
	if(!c->isbanned)
1677 1674
		return;
1679 1676
	c->isbanned = False;
1680 1677
}
1681 1678
1682 -
static void
1679 +
void
1683 1680
unmanage(Client *c) {
1684 1681
	XWindowChanges wc;
1685 1682
1702 1699
	arrange();
1703 1700
}
1704 1701
1705 -
static void
1702 +
void
1706 1703
unmapnotify(XEvent *e) {
1707 1704
	Client *c;
1708 1705
	XUnmapEvent *ev = &e->xunmap;
1711 1708
		unmanage(c);
1712 1709
}
1713 1710
1714 -
static void
1711 +
void
1715 1712
updatebarpos(void) {
1716 1713
	XEvent ev;
1717 1714
1737 1734
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
1738 1735
}
1739 1736
1740 -
static void
1737 +
void
1741 1738
updatesizehints(Client *c) {
1742 1739
	long msize;
1743 1740
	XSizeHints size;
1789 1786
			&& c->maxw == c->minw && c->maxh == c->minh);
1790 1787
}
1791 1788
1792 -
static void
1789 +
void
1793 1790
updatetitle(Client *c) {
1794 1791
	if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name))
1795 1792
		gettextprop(c->win, wmatom[WMName], c->name, sizeof c->name);
1798 1795
/* There's no way to check accesses to destroyed windows, thus those cases are
1799 1796
 * ignored (especially on UnmapNotify's).  Other types of errors call Xlibs
1800 1797
 * default error handler, which may call exit.  */
1801 -
static int
1798 +
int
1802 1799
xerror(Display *dpy, XErrorEvent *ee) {
1803 1800
	if(ee->error_code == BadWindow
1804 1801
	|| (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch)
1814 1811
	return xerrorxlib(dpy, ee); /* may call exit */
1815 1812
}
1816 1813
1817 -
static int
1814 +
int
1818 1815
xerrordummy(Display *dsply, XErrorEvent *ee) {
1819 1816
	return 0;
1820 1817
}
1821 1818
1822 1819
/* Startup Error handler to check if another window manager
1823 1820
 * is already running. */
1824 -
static int
1821 +
int
1825 1822
xerrorstart(Display *dsply, XErrorEvent *ee) {
1826 1823
	otherwm = True;
1827 1824
	return -1;
1828 1825
}
1829 1826
1830 -
static void
1827 +
void
1831 1828
view(const char *arg) {
1832 1829
	unsigned int i;
1833 1830
1839 1836
	arrange();
1840 1837
}
1841 1838
1842 -
static void
1839 +
void
1843 1840
zoom(const char *arg) {
1844 1841
	Client *c;
1845 1842