X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=main.c;h=9d583b2823822ad8620a545a926220585be01ef1;hb=b597fa46370af6594c0980f6c2ddefbe943ee933;hp=561aa37929d53ee53f2dcfe425da85ad8367acbb;hpb=b739721d9ec56379a55228e8e01b618d5932f6ca;p=dwm.git diff --git a/main.c b/main.c index 561aa37..9d583b2 100644 --- a/main.c +++ b/main.c @@ -19,13 +19,15 @@ char stext[1024]; Bool *seltag; -int screen, sx, sy, sw, sh, bx, by, bw, bh, mw; +int bx, by, bw, bh, bmw, mw, screen, sx, sy, sw, sh; unsigned int ntags, numlockmask; Atom wmatom[WMLast], netatom[NetLast]; Bool running = True; Bool issel = True; +Bool maximized = False; Client *clients = NULL; Client *sel = NULL; +Client *stack = NULL; Cursor cursor[CurLast]; Display *dpy; DC dc = {0}; @@ -54,6 +56,7 @@ cleanup() XDestroyWindow(dpy, barwin); XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); XSync(dpy, False); + free(seltag); } static void @@ -121,11 +124,15 @@ setup() seltag[0] = True; /* style */ - dc.bg = getcolor(BGCOLOR); - dc.fg = getcolor(FGCOLOR); - dc.border = getcolor(BORDERCOLOR); + dc.norm[ColBG] = getcolor(NORMBGCOLOR); + dc.norm[ColFG] = getcolor(NORMFGCOLOR); + dc.sel[ColBG] = getcolor(SELBGCOLOR); + dc.sel[ColFG] = getcolor(SELFGCOLOR); + dc.status[ColBG] = getcolor(STATUSBGCOLOR); + dc.status[ColFG] = getcolor(STATUSFGCOLOR); setfont(FONT); + bmw = textw(FLOATSYMBOL) > textw(TILESYMBOL) ? textw(FLOATSYMBOL) : textw(TILESYMBOL); sx = sy = 0; sw = DisplayWidth(dpy, screen); sh = DisplayHeight(dpy, screen); @@ -133,7 +140,7 @@ setup() bx = by = 0; bw = sw; - dc.h = bh = dc.font.height + 4; + dc.h = bh = dc.font.height + 2; wa.override_redirect = 1; wa.background_pixmap = ParentRelative; wa.event_mask = ButtonPressMask | ExposureMask; @@ -145,6 +152,7 @@ setup() dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); dc.gc = XCreateGC(dpy, root, 0, 0); + XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask); strcpy(stext, "dwm-"VERSION); @@ -206,7 +214,7 @@ quit(Arg *arg) /* * There's no way to check accesses to destroyed windows, thus those cases are * ignored (especially on UnmapNotify's). Other types of errors call Xlibs - * default error handler, which calls exit(). + * default error handler, which may call exit. */ int xerror(Display *dpy, XErrorEvent *ee) @@ -221,7 +229,7 @@ xerror(Display *dpy, XErrorEvent *ee) return 0; fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", ee->request_code, ee->error_code); - return xerrorxlib(dpy, ee); /* may call exit() */ + return xerrorxlib(dpy, ee); /* may call exit */ } int