diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 24 |
1 files changed, 13 insertions, 11 deletions
| @@ -170,7 +170,7 @@ static void movemouse(const Arg *arg); | |||
| 170 | static Client *nexttiled(Client *c); | 170 | static Client *nexttiled(Client *c); |
| 171 | static void propertynotify(XEvent *e); | 171 | static void propertynotify(XEvent *e); |
| 172 | static void quit(const Arg *arg); | 172 | static void quit(const Arg *arg); |
| 173 | static void resize(Client *c, int x, int y, int w, int h, Bool sizehints); | 173 | static void resize(Client *c, int x, int y, int w, int h); |
| 174 | static void resizemouse(const Arg *arg); | 174 | static void resizemouse(const Arg *arg); |
| 175 | static void restack(void); | 175 | static void restack(void); |
| 176 | static void run(void); | 176 | static void run(void); |
| @@ -275,6 +275,9 @@ void | |||
| 275 | applysizehints(Client *c, int *w, int *h) { | 275 | applysizehints(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 | ||
| 1087 | void | 1090 | void |
| 1088 | resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | 1091 | resize(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 | ||
