X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=main.c;h=f63a6971d19ef708db5b8f4ca225d462ca9e6beb;hb=1d7674bb22088c5dae110751bd57e75c141e3afb;hp=5b00d0c24f695eda31d5db3bed40ca1b76609f97;hpb=9833610356f7ce033589680fddf87000e5788774;p=dwm.git diff --git a/main.c b/main.c index 5b00d0c..f63a697 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; @@ -207,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) @@ -218,11 +225,12 @@ xerror(Display *dpy, XErrorEvent *ee) || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) - || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)) + || (ee->request_code == X_GrabKey && ee->error_code == BadAccess) + || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) 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