X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=8e7a86a1f7d887cf400359aa291a54e1b4340f58;hp=de20b368fa2ae088696c0e9230f34a94c983d475;hb=c43d7b7587c9639a303b02ff7a44bf18a54f06cb;hpb=8e0f8ffcc63f27bd2e2c666b4e889a3056b3b70b diff --git a/dwm.c b/dwm.c index de20b36..8e7a86a 100644 --- a/dwm.c +++ b/dwm.c @@ -118,7 +118,6 @@ typedef struct { } Regs; struct Monitor { - unsigned int id; int sx, sy, sw, sh, wax, way, wah, waw; double mwfact; Bool *seltags; @@ -1276,7 +1275,6 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { XWindowChanges wc; m = c->monitor; - if(sizehints) { /* set minimum possible */ if (w < 1) @@ -1325,6 +1323,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { x = m->sx; if(y + h + 2 * c->border < m->sy) y = m->sy; + fprintf(stderr, "resize %d %d %d %d (%d %d %d %d)\n", x, y , w, h, m->sx, m->sy, m->sw, m->sh); if(c->x != x || c->y != y || c->w != w || c->h != h) { c->x = wc.x = x; c->y = wc.y = y; @@ -1603,9 +1602,8 @@ setup(void) { for(i = 0; i < mcount; i++) { /* init geometry */ m = &monitors[i]; - m->id = i; - if (mcount != 1 && isxinerama) { + if(mcount != 1 && isxinerama) { m->sx = info[i].x_org; m->sy = info[i].y_org; m->sw = info[i].width; @@ -1727,9 +1725,9 @@ tile(Monitor *m) { Client *c, *mc; domwfact = dozoom = True; - - nx = ny = nw = 0; /* gcc stupidity requires this */ - + nx = m->wax; + ny = m->way; + nw = 0; for(n = 0, c = nexttiled(clients, m); c; c = nexttiled(c->next, m)) n++; @@ -1757,16 +1755,17 @@ tile(Monitor *m) { else nh = th - 2 * c->border; } + fprintf(stderr, "tile %d %d %d %d\n", nx, ny, nw, nh); resize(c, nx, ny, nw, nh, RESIZEHINTS); if((RESIZEHINTS) && ((c->h < bh) || (c->h > nh) || (c->w < bh) || (c->w > nw))) /* client doesn't accept size constraints */ resize(c, nx, ny, nw, nh, False); if(n > 1 && th != m->wah) ny = c->y + c->h + 2 * c->border; - i++; } } + void togglebar(const char *arg) { if(bpos == BarOff) @@ -1824,6 +1823,7 @@ unban(Client *c) { void unmanage(Client *c) { + Monitor *m = c->monitor; XWindowChanges wc; wc.border_width = c->oldborder; @@ -1842,7 +1842,7 @@ unmanage(Client *c) { XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); - arrange(NULL); + arrange(m); } void @@ -2062,8 +2062,7 @@ selectmonitor(const char *arg) { int main(int argc, char *argv[]) { if(argc == 2 && !strcmp("-v", argv[1])) - eprint("dwm-"VERSION", © 2006-2008 Anselm R. Garbe, Sander van Dijk, " - "Jukka Salmi, Premysl Hruby, Szabolcs Nagy, Christof Musik\n"); + eprint("dwm-"VERSION", © 2006-2008 dwm engineers, see LICENSE for details\n"); else if(argc != 1) eprint("usage: dwm [-v]\n");