- // TODO: bpos per screen?
- bpos = BARPOS;
- wa.override_redirect = 1;
- wa.background_pixmap = ParentRelative;
- wa.event_mask = ButtonPressMask | ExposureMask;
-
- /* init bars */
- m->barwin = XCreateWindow(dpy, m->root, m->sx, m->sy, m->sw, bh, 0,
- DefaultDepth(dpy, m->screen), CopyFromParent, DefaultVisual(dpy, m->screen),
- CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
- XDefineCursor(dpy, m->barwin, cursor[CurNormal]);
- updatebarpos(m);
- XMapRaised(dpy, m->barwin);
- strcpy(stext, "dwm-"VERSION);
- m->dc.drawable = XCreatePixmap(dpy, m->root, m->sw, bh, DefaultDepth(dpy, m->screen));
- m->dc.gc = XCreateGC(dpy, m->root, 0, 0);
- XSetLineAttributes(dpy, m->dc.gc, 1, LineSolid, CapButt, JoinMiter);
- if(!m->dc.font.set)
- XSetFont(dpy, m->dc.gc, m->dc.font.xfont->fid);
-
- /* EWMH support per monitor */
- XChangeProperty(dpy, m->root, netatom[NetSupported], XA_ATOM, 32,
- PropModeReplace, (unsigned char *) netatom, NetLast);
-
- /* select for events */
- wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
- | EnterWindowMask | LeaveWindowMask | StructureNotifyMask;
- XChangeWindowAttributes(dpy, m->root, CWEventMask | CWCursor, &wa);
- XSelectInput(dpy, m->root, wa.event_mask);
+ /* init tags */
+ seltags = emallocz(TAGSZ);
+ prevtags = emallocz(TAGSZ);
+ seltags[0] = prevtags[0] = True;
+
+ /* init layouts */
+ lt = &layouts[0];
+
+ /* init bar */
+ for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {
+ w = textw(layouts[i].symbol);
+ if(w > blw)
+ blw = w;
+ }
+ for(bgw = i = 0; LENGTH(geoms) > 1 && i < LENGTH(geoms); i++) {
+ w = textw(geoms[i].symbol);
+ if(w > bgw)
+ bgw = w;