+ m->seltags = emallocz(sizeof initags);
+ m->prevtags = emallocz(sizeof initags);
+
+ memcpy(m->seltags, initags, sizeof initags);
+ memcpy(m->prevtags, initags, sizeof initags);
+
+ /* init layouts */
+ m->mwfact = MWFACT;
+ m->layout = &layouts[0];
+
+ // 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, root, m->sx, m->sy, m->sw, bh, 0,
+ DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen),
+ CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
+ XDefineCursor(dpy, m->barwin, cursor[CurNormal]);
+ updatebarpos(m);
+ XMapRaised(dpy, m->barwin);
+ strcpy(stext, "dwm-"VERSION);
+
+ /* EWMH support per monitor */
+ XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
+ PropModeReplace, (unsigned char *) netatom, NetLast);
+
+ /* select for events */
+ wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
+ | EnterWindowMask | LeaveWindowMask | StructureNotifyMask;
+ XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
+ XSelectInput(dpy, root, wa.event_mask);
+ }
+ if(info)
+ XFree(info);
+
+ /* grab keys */
+ grabkeys();
+
+ /* init tags */
+ compileregs();
+
+ selmonitor = monitorat();
+ fprintf(stderr, "selmonitor == %d\n", selmonitor);