X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=main.c;h=6d84a77a4d4335f56ab5c438bf0a2d2b81c2e491;hb=10d13f01ff764ba0e875adf5d2b83c49aa08d148;hp=471cfc2f7d249a35b9a98f88b9450722a5a87925;hpb=5a1a2edf0e584e660e16d2e01094851e0f9161e2;p=dwm.git diff --git a/main.c b/main.c index 471cfc2..6d84a77 100644 --- a/main.c +++ b/main.c @@ -11,13 +11,16 @@ #include #include #include +#include /* extern */ char stext[256]; int screen, sx, sy, sw, sh, wax, way, waw, wah; -unsigned int bh, bpos, ntags, numlockmask; -Atom wmatom[WMLast], netatom[NetLast]; +unsigned int bh, ntags; +unsigned int bpos = BARPOS; +unsigned int numlockmask = 0; +Atom dwmconfig, wmatom[WMLast], netatom[NetLast]; Bool *seltag; Bool selscreen = True; Client *clients = NULL; @@ -39,7 +42,7 @@ cleanup(void) { close(STDIN_FILENO); while(stack) { unban(stack); - unmanage(stack); + unmanage(stack, NormalState); } if(dc.font.set) XFreeFontSet(dpy, dc.font.set); @@ -137,6 +140,7 @@ setup(void) { XSetWindowAttributes wa; /* init atoms */ + dwmconfig = XInternAtom(dpy, "_DWM_CONFIG", False); wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); @@ -149,7 +153,6 @@ setup(void) { cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); /* init modifier map */ - numlockmask = 0; modmap = XGetModifierMapping(dpy); for (i = 0; i < 8; i++) for (j = 0; j < modmap->max_keypermod; j++) { @@ -191,7 +194,6 @@ setup(void) { DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); XDefineCursor(dpy, barwin, cursor[CurNormal]); - bpos = BARPOS; updatebarpos(); XMapRaised(dpy, barwin); strcpy(stext, "dwm-"VERSION);