X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=4c001fa05a487383bd684db3e7445bea2b32b4bb;hp=88e0b1b68c1466721706ed3d6e59b0e47112f4e1;hb=cdb8e274531e5e82818d90e2cc4e3b46e7fe8eb6;hpb=fa5ae54bbb7f890540f4700809e00497018e0239 diff --git a/dwm.c b/dwm.c index 88e0b1b..4c001fa 100644 --- a/dwm.c +++ b/dwm.c @@ -1,4 +1,4 @@ -#define XINULATOR /* debug, simulates dual head */ +//#define XINULATOR /* debug, simulates dual head */ /* See LICENSE file for copyright and license details. * * dynamic window manager is designed like any other X client as well. It is @@ -1045,8 +1045,8 @@ manage(Window w, XWindowAttributes *wa) { c->y = sy + sh - HEIGHT(c); c->x = MAX(c->x, sx); /* only fix client y-offset, if the client center might cover the bar */ - c->y = MAX(c->y, ((selmon->by == 0) && (c->x + (c->w / 2) >= selmon->wx) - && (c->x + (c->w / 2) < selmon->wx + selmon->ww)) ? bh : sy); + c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w / 2) >= c->mon->wx) + && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : sy); c->bw = borderpx; } @@ -1271,10 +1271,10 @@ restack(Monitor *m) { XWindowChanges wc; drawbars(); - if(!selmon->sel) + if(!m->sel) return; - if(m == selmon && (selmon->sel->isfloating || !lt[m->sellt]->arrange)) - XRaiseWindow(dpy, selmon->sel->win); + if(m->sel->isfloating || !lt[m->sellt]->arrange) + XRaiseWindow(dpy, m->sel->win); if(lt[m->sellt]->arrange) { wc.stack_mode = Below; wc.sibling = m->barwin; @@ -1649,9 +1649,11 @@ updatebarpos(Monitor *m) { void updategeom(void) { - int i, n = 1; + int i, di, n = 1, x, y; + unsigned int dui; Client *c; Monitor *newmons = NULL, *m, *tm; + Window dummy; #ifdef XINULATOR n = 2; @@ -1720,16 +1722,6 @@ updategeom(void) { 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 */ @@ -1744,18 +1736,13 @@ updategeom(void) { } /* 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; - } - } + selmon = newmons; + 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; + } /* final assignment of new monitors */ cleanupmons();