summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-02-22 10:34:12 +0000
committerAnselm R Garbe <garbeam@gmail.com>2008-02-22 10:34:12 +0000
commitde5b294edce70dae164855fb06e0472441ae28ee (patch)
treeebf1695586cb9242bdbd58606491bd838b0295e5
parentcrash fix (diff)
downloaddwm-de5b294edce70dae164855fb06e0472441ae28ee.tar.gz
dwm-de5b294edce70dae164855fb06e0472441ae28ee.zip
some other fixes, resize contains a minor bug
Diffstat (limited to '')
-rw-r--r--dwm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/dwm.c b/dwm.c
index de20b36..7684646 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1276,7 +1276,6 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
1276 XWindowChanges wc; 1276 XWindowChanges wc;
1277 1277
1278 m = c->monitor; 1278 m = c->monitor;
1279
1280 if(sizehints) { 1279 if(sizehints) {
1281 /* set minimum possible */ 1280 /* set minimum possible */
1282 if (w < 1) 1281 if (w < 1)
@@ -1325,6 +1324,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
1325 x = m->sx; 1324 x = m->sx;
1326 if(y + h + 2 * c->border < m->sy) 1325 if(y + h + 2 * c->border < m->sy)
1327 y = m->sy; 1326 y = m->sy;
1327 fprintf(stderr, "resize %d %d %d %d (%d %d %d %d)\n", x, y , w, h, m->sx, m->sy, m->sw, m->sh);
1328 if(c->x != x || c->y != y || c->w != w || c->h != h) { 1328 if(c->x != x || c->y != y || c->w != w || c->h != h) {
1329 c->x = wc.x = x; 1329 c->x = wc.x = x;
1330 c->y = wc.y = y; 1330 c->y = wc.y = y;
@@ -1605,7 +1605,7 @@ setup(void) {
1605 m = &monitors[i]; 1605 m = &monitors[i];
1606 m->id = i; 1606 m->id = i;
1607 1607
1608 if (mcount != 1 && isxinerama) { 1608 if(mcount != 1 && isxinerama) {
1609 m->sx = info[i].x_org; 1609 m->sx = info[i].x_org;
1610 m->sy = info[i].y_org; 1610 m->sy = info[i].y_org;
1611 m->sw = info[i].width; 1611 m->sw = info[i].width;
@@ -1727,9 +1727,9 @@ tile(Monitor *m) {
1727 Client *c, *mc; 1727 Client *c, *mc;
1728 1728
1729 domwfact = dozoom = True; 1729 domwfact = dozoom = True;
1730 1730 nx = m->wax;
1731 nx = ny = nw = 0; /* gcc stupidity requires this */ 1731 ny = m->way;
1732 1732 nw = 0;
1733 for(n = 0, c = nexttiled(clients, m); c; c = nexttiled(c->next, m)) 1733 for(n = 0, c = nexttiled(clients, m); c; c = nexttiled(c->next, m))
1734 n++; 1734 n++;
1735 1735
@@ -1757,16 +1757,17 @@ tile(Monitor *m) {
1757 else 1757 else
1758 nh = th - 2 * c->border; 1758 nh = th - 2 * c->border;
1759 } 1759 }
1760 fprintf(stderr, "tile %d %d %d %d\n", nx, ny, nw, nh);
1760 resize(c, nx, ny, nw, nh, RESIZEHINTS); 1761 resize(c, nx, ny, nw, nh, RESIZEHINTS);
1761 if((RESIZEHINTS) && ((c->h < bh) || (c->h > nh) || (c->w < bh) || (c->w > nw))) 1762 if((RESIZEHINTS) && ((c->h < bh) || (c->h > nh) || (c->w < bh) || (c->w > nw)))
1762 /* client doesn't accept size constraints */ 1763 /* client doesn't accept size constraints */
1763 resize(c, nx, ny, nw, nh, False); 1764 resize(c, nx, ny, nw, nh, False);
1764 if(n > 1 && th != m->wah) 1765 if(n > 1 && th != m->wah)
1765 ny = c->y + c->h + 2 * c->border; 1766 ny = c->y + c->h + 2 * c->border;
1766
1767 i++; 1767 i++;
1768 } 1768 }
1769} 1769}
1770
1770void 1771void
1771togglebar(const char *arg) { 1772togglebar(const char *arg) {
1772 if(bpos == BarOff) 1773 if(bpos == BarOff)
@@ -1824,6 +1825,7 @@ unban(Client *c) {
1824 1825
1825void 1826void
1826unmanage(Client *c) { 1827unmanage(Client *c) {
1828 Monitor *m = c->monitor;
1827 XWindowChanges wc; 1829 XWindowChanges wc;
1828 1830
1829 wc.border_width = c->oldborder; 1831 wc.border_width = c->oldborder;
@@ -1842,7 +1844,7 @@ unmanage(Client *c) {
1842 XSync(dpy, False); 1844 XSync(dpy, False);
1843 XSetErrorHandler(xerror); 1845 XSetErrorHandler(xerror);
1844 XUngrabServer(dpy); 1846 XUngrabServer(dpy);
1845 arrange(NULL); 1847 arrange(m);
1846} 1848}
1847 1849
1848void 1850void