+ m->screen_number = 0;
+ m->wx = sx;
+ m->wy = sy;
+ m->ww = sw;
+ m->wh = sh;
+ }
+
+ /* bar geometry setup */
+ for(m = newmons; m; m = m->next) {
+ /* TODO: consider removing the following values from config.h */
+ m->seltags = 0;
+ m->sellt = 0;
+ m->tagset[0] = m->tagset[1] = 1;
+ m->mfact = mfact;
+ m->showbar = showbar;
+ m->topbar = topbar;
+ if(m->showbar) {
+ m->wh -= bh;
+ m->by = m->topbar ? m->wy : m->wy + m->wh;
+ m->wy = m->topbar ? m->wy + bh : m->wy;
+ }
+ else
+ m->by = -bh;
+ /* reassign all clients with same screen number */
+ for(c = clients; c; c = c->next)
+ if(c->m->screen_number == m->screen_number)
+ c->m = m;
+ }
+
+ /* reassign left over clients with disappeared screen number */
+ for(c = clients; c; c = c->next)
+ if(c->m->screen_number >= n)
+ c->m = newmons;
+
+ /* select focused monitor */
+ if(!selmon) {
+ selmon = newmons;
+ int di, x, y;
+ unsigned int dui;
+ Window dummy;
+ if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui))
+ for(m = newmons; m; m = m->next)
+ if(INRECT(x, y, m->wx, m->wy, m->ww, m->wh)) {
+ selmon = m;
+ break;
+ }