X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/14343e69cc596b847f71f1e825d3019ab1a29aa8..04db03a4e69eba88c56c12128340125fb0ef1960:/dwm.c diff --git a/dwm.c b/dwm.c index 169adcb..e2d7423 100644 --- a/dwm.c +++ b/dwm.c @@ -462,6 +462,7 @@ cleanup(void) { Arg a = {.ui = ~0}; Layout foo = { "", NULL }; Monitor *m; + size_t i; view(&a); selmon->lt[selmon->sellt] = &foo; @@ -471,15 +472,13 @@ cleanup(void) { XUngrabKey(dpy, AnyKey, AnyModifier, root); while(mons) cleanupmon(mons); - drw_cur_free(drw, cursor[CurNormal]); - drw_cur_free(drw, cursor[CurResize]); - drw_cur_free(drw, cursor[CurMove]); - drw_clr_free(scheme[SchemeNorm].border); - drw_clr_free(scheme[SchemeNorm].bg); - drw_clr_free(scheme[SchemeNorm].fg); - drw_clr_free(scheme[SchemeSel].border); - drw_clr_free(scheme[SchemeSel].bg); - drw_clr_free(scheme[SchemeSel].fg); + for(i = 0; i < CurLast; i++) + drw_cur_free(drw, cursor[i]); + for(i = 0; i < SchemeLast; i++) { + drw_clr_free(scheme[i].border); + drw_clr_free(scheme[i].bg); + drw_clr_free(scheme[i].fg); + } drw_free(drw); XSync(dpy, False); XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); @@ -558,7 +557,7 @@ configurenotify(XEvent *e) { XConfigureEvent *ev = &e->xconfigure; Bool dirty; - // TODO: updategeom handling sucks, needs to be simplified + /* TODO: updategeom handling sucks, needs to be simplified */ if(ev->window == root) { dirty = (sw != ev->width || sh != ev->height); sw = ev->width; @@ -1510,7 +1509,7 @@ setup(void) { drw = drw_create(dpy, screen, root, sw, sh); drw_load_fonts(drw, fonts, LENGTH(fonts)); if (!drw->fontcount) - die("No fonts could be loaded.\n"); + die("no fonts could be loaded.\n"); bh = drw->fonts[0]->h + 2; updategeom(); /* init atoms */ @@ -1573,7 +1572,7 @@ showhide(Client *c) { void sigchld(int unused) { if(signal(SIGCHLD, sigchld) == SIG_ERR) - die("Can't install SIGCHLD handler"); + die("can't install SIGCHLD handler:"); while(0 < waitpid(-1, NULL, WNOHANG)); } @@ -2055,7 +2054,7 @@ zoom(const Arg *arg) { int main(int argc, char *argv[]) { if(argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION", © 2006-2014 dwm engineers, see LICENSE for details\n"); + die("dwm-"VERSION", © 2006-2015 dwm engineers, see LICENSE for details\n"); else if(argc != 1) die("usage: dwm [-v]\n"); if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())