X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=dwm.c;h=66daba3ab4335f000492c390a7a905449e11f8c3;hb=4426032450777e63ac9a8967cd67382497954c51;hp=0a1ade26013d7f73b541d02ba2c3839171659ce5;hpb=ca3e847e459e1ba43f45513877d39d50cce7a0c5;p=dwm.git diff --git a/dwm.c b/dwm.c index 0a1ade2..66daba3 100644 --- a/dwm.c +++ b/dwm.c @@ -1263,9 +1263,10 @@ reapply(const char *arg) { void resize(Client *c, int x, int y, int w, int h, Bool sizehints) { + Monitor *m; XWindowChanges wc; - //Monitor scr = monitors[monitorat()]; -// c->monitor = monitorat(); + + m = &monitors[c->monitor]; if(sizehints) { /* set minimum possible */ @@ -1307,17 +1308,14 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { } if(w <= 0 || h <= 0) return; - /* TODO: offscreen appearance fixes */ - /* - if(x > scr.sw) - x = scr.sw - w - 2 * c->border; - if(y > scr.sh) - y = scr.sh - h - 2 * c->border; - if(x + w + 2 * c->border < scr.sx) - x = scr.sx; - if(y + h + 2 * c->border < scr.sy) - y = scr.sy; - */ + if(x > m->sw) + x = m->sw - w - 2 * c->border; + if(y > m->sh) + y = m->sh - h - 2 * c->border; + if(x + w + 2 * c->border < m->sx) + x = m->sx; + if(y + h + 2 * c->border < m->sy) + y = m->sy; if(c->x != x || c->y != y || c->w != w || c->h != h) { c->x = wc.x = x; c->y = wc.y = y; @@ -2011,11 +2009,11 @@ viewprevtag(const char *arg) { void zoom(const char *arg) { - Client *c; + Client *c = sel; if(!sel || !dozoom || sel->isfloating) return; - if((c = sel) == nexttiled(clients, c->monitor)) + if(c == nexttiled(clients, c->monitor)) if(!(c = nexttiled(c->next, c->monitor))) return; detach(c);