X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=main.c;h=0ae288c50c4ec8d647a58e478c143663034b2576;hb=86953bd68249662b5d7a9ae6741744ab8bf30aa1;hp=23fd7bd4ea0f2898ed3b16936187bbead2a388ae;hpb=32563abe86100150645c285c9a769257836bd86d;p=dwm.git diff --git a/main.c b/main.c index 23fd7bd..0ae288c 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,4 @@ -/* © 2006-2007 Anselm R. Garbe - * © 2006-2007 Sander van Dijk - * See LICENSE file for license details. */ +/* See LICENSE file for copyright and license details. */ #include "dwm.h" #include #include @@ -13,14 +11,17 @@ #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]; -Bool *seltag; +unsigned int bh, ntags; +unsigned int bpos = BARPOS; +unsigned int numlockmask = 0; +Atom dwmconfig, wmatom[WMLast], netatom[NetLast]; +Bool *seltags; Bool selscreen = True; Client *clients = NULL; Client *sel = NULL; @@ -40,9 +41,8 @@ static void cleanup(void) { close(STDIN_FILENO); while(stack) { - if(stack->isbanned) - XMoveWindow(dpy, stack->win, stack->x, stack->y); - unmanage(stack); + unban(stack); + unmanage(stack, NormalState); } if(dc.font.set) XFreeFontSet(dpy, dc.font.set); @@ -57,7 +57,7 @@ cleanup(void) { XFreeCursor(dpy, cursor[CurMove]); XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); XSync(dpy, False); - free(seltag); + free(seltags); } static unsigned long @@ -140,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); @@ -152,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++) { @@ -170,8 +170,8 @@ setup(void) { grabkeys(); compileregs(); for(ntags = 0; tags[ntags]; ntags++); - seltag = emallocz(sizeof(Bool) * ntags); - seltag[0] = True; + seltags = emallocz(sizeof(Bool) * ntags); + seltags[0] = True; /* style */ dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR); dc.norm[ColBG] = initcolor(NORMBGCOLOR); @@ -194,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); @@ -279,7 +278,7 @@ main(int argc, char *argv[]) { XEvent ev; if(argc == 2 && !strcmp("-v", argv[1])) - eprint("dwm-"VERSION", © 2004-2007 Anselm R. Garbe, Sander van Dijk\n"); + eprint("dwm-"VERSION", © 2006-2007 A. R. Garbe, S. van Dijk, J. Salmi, P. Hruby, S. Nagy\n"); else if(argc != 1) eprint("usage: dwm [-v]\n"); setlocale(LC_CTYPE, "");