summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorarg@garbe.us <unknown>2009-03-03 11:22:16 +0000
committerarg@garbe.us <unknown>2009-03-03 11:22:16 +0000
commitea0008cba24b57f7955541568c8c527c06329ccd (patch)
tree5490defab290db612640decb704f59b1e2ec0220 /dwm.c
parentapplied Gottox' resizehints patch, thanks Gottox! (diff)
downloaddwm-ea0008cba24b57f7955541568c8c527c06329ccd.tar.gz
dwm-ea0008cba24b57f7955541568c8c527c06329ccd.zip
applied the patch I missed from Gottox, thanks mate!
Diffstat (limited to '')
-rw-r--r--dwm.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/dwm.c b/dwm.c
index e1c0645..3ae709b 100644
--- a/dwm.c
+++ b/dwm.c
@@ -170,7 +170,7 @@ static void movemouse(const Arg *arg);
170static Client *nexttiled(Client *c); 170static Client *nexttiled(Client *c);
171static void propertynotify(XEvent *e); 171static void propertynotify(XEvent *e);
172static void quit(const Arg *arg); 172static void quit(const Arg *arg);
173static void resize(Client *c, int x, int y, int w, int h, Bool sizehints); 173static void resize(Client *c, int x, int y, int w, int h);
174static void resizemouse(const Arg *arg); 174static void resizemouse(const Arg *arg);
175static void restack(void); 175static void restack(void);
176static void run(void); 176static void run(void);
@@ -275,6 +275,9 @@ void
275applysizehints(Client *c, int *w, int *h) { 275applysizehints(Client *c, int *w, int *h) {
276 Bool baseismin; 276 Bool baseismin;
277 277
278 if(!resizehints && !c->isfloating)
279 return;
280
278 /* see last two sentences in ICCCM 4.1.2.3 */ 281 /* see last two sentences in ICCCM 4.1.2.3 */
279 baseismin = c->basew == c->minw && c->baseh == c->minh; 282 baseismin = c->basew == c->minw && c->baseh == c->minh;
280 283
@@ -981,7 +984,7 @@ monocle(void) {
981 Client *c; 984 Client *c;
982 985
983 for(c = nexttiled(clients); c; c = nexttiled(c->next)) { 986 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
984 resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, resizehints); 987 resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw);
985 } 988 }
986} 989}
987 990
@@ -1029,7 +1032,7 @@ movemouse(const Arg *arg) {
1029 togglefloating(NULL); 1032 togglefloating(NULL);
1030 } 1033 }
1031 if(!lt[sellt]->arrange || c->isfloating) 1034 if(!lt[sellt]->arrange || c->isfloating)
1032 resize(c, nx, ny, c->w, c->h, False); 1035 resize(c, nx, ny, c->w, c->h);
1033 break; 1036 break;
1034 } 1037 }
1035 } 1038 }
@@ -1085,11 +1088,10 @@ quit(const Arg *arg) {
1085} 1088}
1086 1089
1087void 1090void
1088resize(Client *c, int x, int y, int w, int h, Bool sizehints) { 1091resize(Client *c, int x, int y, int w, int h) {
1089 XWindowChanges wc; 1092 XWindowChanges wc;
1090 1093
1091 if(sizehints) 1094 applysizehints(c, &w, &h);
1092 applysizehints(c, &w, &h);
1093 if(w <= 0 || h <= 0) 1095 if(w <= 0 || h <= 0)
1094 return; 1096 return;
1095 if(x > sx + sw) 1097 if(x > sx + sw)
@@ -1154,7 +1156,7 @@ resizemouse(const Arg *arg) {
1154 togglefloating(NULL); 1156 togglefloating(NULL);
1155 } 1157 }
1156 if(!lt[sellt]->arrange || c->isfloating) 1158 if(!lt[sellt]->arrange || c->isfloating)
1157 resize(c, c->x, c->y, nw, nh, True); 1159 resize(c, c->x, c->y, nw, nh);
1158 break; 1160 break;
1159 } 1161 }
1160 } 1162 }
@@ -1344,7 +1346,7 @@ showhide(Client *c, unsigned int ntiled) {
1344 if(ISVISIBLE(c)) { /* show clients top down */ 1346 if(ISVISIBLE(c)) { /* show clients top down */
1345 XMoveWindow(dpy, c->win, c->x, c->y); 1347 XMoveWindow(dpy, c->win, c->x, c->y);
1346 if(!lt[sellt]->arrange || c->isfloating) 1348 if(!lt[sellt]->arrange || c->isfloating)
1347 resize(c, c->x, c->y, c->w, c->h, True); 1349 resize(c, c->x, c->y, c->w, c->h);
1348 showhide(c->snext, ntiled); 1350 showhide(c->snext, ntiled);
1349 } 1351 }
1350 else { /* hide clients bottom up */ 1352 else { /* hide clients bottom up */
@@ -1405,7 +1407,7 @@ tile(void) {
1405 /* master */ 1407 /* master */
1406 c = nexttiled(clients); 1408 c = nexttiled(clients);
1407 mw = mfact * ww; 1409 mw = mfact * ww;
1408 resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints); 1410 resize(c, wx, wy, (n == 1 ? ww : mw) - 2 * c->bw, wh - 2 * c->bw);
1409 1411
1410 if(--n == 0) 1412 if(--n == 0)
1411 return; 1413 return;
@@ -1420,7 +1422,7 @@ tile(void) {
1420 1422
1421 for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { 1423 for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
1422 resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n) 1424 resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
1423 ? wy + wh - y - 2 * c->bw : h - 2 * c->bw), resizehints); 1425 ? wy + wh - y - 2 * c->bw : h - 2 * c->bw));
1424 if(h != wh) 1426 if(h != wh)
1425 y = c->y + HEIGHT(c); 1427 y = c->y + HEIGHT(c);
1426 } 1428 }
@@ -1440,7 +1442,7 @@ togglefloating(const Arg *arg) {
1440 return; 1442 return;
1441 sel->isfloating = !sel->isfloating || sel->isfixed; 1443 sel->isfloating = !sel->isfloating || sel->isfixed;
1442 if(sel->isfloating) 1444 if(sel->isfloating)
1443 resize(sel, sel->x, sel->y, sel->w, sel->h, True); 1445 resize(sel, sel->x, sel->y, sel->w, sel->h);
1444 arrange(); 1446 arrange();
1445} 1447}
1446 1448