From adaa28a6e600f636f5e86244ccef69e98419ba1a Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Sat, 15 Jul 2006 17:00:56 +0200 Subject: proceeded with cleaning up, sorting functions, etc --- main.c | 71 +++++++++++++++++++++++++++--------------------------------------- 1 file changed, 29 insertions(+), 42 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 39172ee3..b96157cf 100644 --- a/main.c +++ b/main.c @@ -3,31 +3,17 @@ * See LICENSE file for license details. */ +#include "dwm.h" + #include -#include #include #include #include #include - #include #include #include -#include "dwm.h" - -/********** CUSTOMIZE **********/ - -char *tags[TLast] = { - [Tscratch] = "scratch", - [Tdev] = "dev", - [Twww] = "www", - [Twork] = "work", -}; - -/********** CUSTOMIZE **********/ - -/* X structs */ Display *dpy; Window root, barwin; Atom wm_atom[WMLast], net_atom[NetLast]; @@ -48,8 +34,17 @@ static const char version[] = "dwm-" VERSION ", (C)opyright MMVI Anselm R. Garbe\n"; static int (*xerrorxlib)(Display *, XErrorEvent *); +/* static functions */ + static void -usage() { eprint("usage: dwm [-v]\n"); } +cleanup() +{ + while(sel) { + resize(sel, True); + unmanage(sel); + } + XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); +} static void scan() @@ -73,22 +68,6 @@ scan() XFree(wins); } -static void -cleanup() -{ - while(sel) { - resize(sel, True); - unmanage(sel); - } - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); -} - -void -quit(Arg *arg) -{ - running = False; -} - static int win_property(Window w, Atom a, Atom t, long l, unsigned char **prop) { @@ -109,6 +88,19 @@ win_property(Window w, Atom a, Atom t, long l, unsigned char **prop) return res; } +/* + * Startup Error handler to check if another window manager + * is already running. + */ +static int +xerrorstart(Display *dsply, XErrorEvent *ee) +{ + otherwm = True; + return -1; +} + +/* extern functions */ + int getproto(Window w) { @@ -144,15 +136,10 @@ sendevent(Window w, Atom a, long value) XFlush(dpy); } -/* - * Startup Error handler to check if another window manager - * is already running. - */ -static int -xerrorstart(Display *dsply, XErrorEvent *ee) +void +quit(Arg *arg) { - otherwm = True; - return -1; + running = False; } /* @@ -201,7 +188,7 @@ main(int argc, char *argv[]) exit(0); break; default: - usage(); + eprint("usage: dwm [-v]\n"); break; } } -- cgit v1.2.3