- m->screen_number = 0;
- m->wx = sx;
- m->my = m->wy = sy;
- m->ww = sw;
- m->mh = m->wh = sh;
- }
-
- /* bar geometry setup */
- for(m = newmons; m; m = m->next) {
- /* TODO: consider removing the following values from config.h */
- m->clients = NULL;
- m->sel = NULL;
- m->stack = NULL;
- m->seltags = 0;
- m->sellt = 0;
- m->tagset[0] = m->tagset[1] = 1;
- m->mfact = mfact;
- m->showbar = showbar;
- m->topbar = topbar;
- updatebarpos(m);
- /* reassign all clients with same screen number */
- for(tm = mons; tm; tm = tm->next)
- if(tm->screen_number == m->screen_number) {
- m->clients = tm->clients;
- m->sel = m->stack = tm->stack;
- tm->clients = NULL;
- tm->stack = NULL;
- for(c = m->clients; c; c = c->next)
- c->mon = m;
- }
- }
-
- /* reassign left over clients of disappeared monitors */
- for(tm = mons; tm; tm = tm->next) {
- while(tm->clients) {
- c = tm->clients->next;
- tm->clients->next = newmons->clients;
- tm->clients->mon = newmons;
- newmons->clients = tm->clients;
- tm->clients = c;
- }
- while(tm->stack) {
- c = tm->stack->snext;
- tm->stack->snext = newmons->stack;
- newmons->sel = newmons->stack = tm->stack;
- tm->stack = c;
+ if(!mons)
+ mons = createmon();
+ if(mons->mw != sw || mons->mh != sh) {
+ dirty = True;
+ mons->mw = mons->ww = sw;
+ mons->mh = mons->wh = sh;
+ updatebarpos(mons);