main.c
changeset 953 d7de5c7bdbe4
parent 949 99ee5c370f94
child 960 b5f856fcef4c
equal deleted inserted replaced
952:4f66942cc63b 953:d7de5c7bdbe4
     9 #include <sys/select.h>
     9 #include <sys/select.h>
    10 #include <X11/cursorfont.h>
    10 #include <X11/cursorfont.h>
    11 #include <X11/keysym.h>
    11 #include <X11/keysym.h>
    12 #include <X11/Xatom.h>
    12 #include <X11/Xatom.h>
    13 #include <X11/Xproto.h>
    13 #include <X11/Xproto.h>
       
    14 #include <X11/Xutil.h>
    14 
    15 
    15 /* extern */
    16 /* extern */
    16 
    17 
    17 char stext[256];
    18 char stext[256];
    18 int screen, sx, sy, sw, sh, wax, way, waw, wah;
    19 int screen, sx, sy, sw, sh, wax, way, waw, wah;
    19 unsigned int bh, ntags;
    20 unsigned int bh, ntags;
    20 unsigned int bpos = BARPOS;
    21 unsigned int bpos = BARPOS;
    21 unsigned int numlockmask = 0;
    22 unsigned int numlockmask = 0;
    22 Atom dwmtags, wmatom[WMLast], netatom[NetLast];
    23 Atom dwmconfig, wmatom[WMLast], netatom[NetLast];
    23 Bool *seltag;
    24 Bool *seltag;
    24 Bool selscreen = True;
    25 Bool selscreen = True;
    25 Client *clients = NULL;
    26 Client *clients = NULL;
    26 Client *sel = NULL;
    27 Client *sel = NULL;
    27 Client *stack = NULL;
    28 Client *stack = NULL;
    39 static void
    40 static void
    40 cleanup(void) {
    41 cleanup(void) {
    41 	close(STDIN_FILENO);
    42 	close(STDIN_FILENO);
    42 	while(stack) {
    43 	while(stack) {
    43 		unban(stack);
    44 		unban(stack);
    44 		unmanage(stack);
    45 		unmanage(stack, NormalState);
    45 	}
    46 	}
    46 	if(dc.font.set)
    47 	if(dc.font.set)
    47 		XFreeFontSet(dpy, dc.font.set);
    48 		XFreeFontSet(dpy, dc.font.set);
    48 	else
    49 	else
    49 		XFreeFont(dpy, dc.font.xfont);
    50 		XFreeFont(dpy, dc.font.xfont);
   137 	Window w;
   138 	Window w;
   138 	XModifierKeymap *modmap;
   139 	XModifierKeymap *modmap;
   139 	XSetWindowAttributes wa;
   140 	XSetWindowAttributes wa;
   140 
   141 
   141 	/* init atoms */
   142 	/* init atoms */
   142 	dwmtags = XInternAtom(dpy, "__DWM_TAGS", False);
   143 	dwmconfig = XInternAtom(dpy, "_DWM_CONFIG", False);
   143 	wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
   144 	wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
   144 	wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
   145 	wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
   145 	wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
   146 	wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
   146 	netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
   147 	netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
   147 	netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
   148 	netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);