diff options
| author | Anselm R Garbe <garbeam@gmail.com> | 2008-02-20 08:13:41 +0000 |
|---|---|---|
| committer | Anselm R Garbe <garbeam@gmail.com> | 2008-02-20 08:13:41 +0000 |
| commit | e0f039789643381485dab5c467f66db5162d4f63 (patch) | |
| tree | 6c43539e190efe07746803d47edc66cbd9c73ce2 /dwm.c | |
| parent | applied some necessary changes (diff) | |
| download | dwm-e0f039789643381485dab5c467f66db5162d4f63.tar.gz dwm-e0f039789643381485dab5c467f66db5162d4f63.zip | |
resize handles offscreen issues
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 24 |
1 files changed, 11 insertions, 13 deletions
| @@ -1263,9 +1263,10 @@ reapply(const char *arg) { | |||
| 1263 | 1263 | ||
| 1264 | void | 1264 | void |
| 1265 | resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | 1265 | resize(Client *c, int x, int y, int w, int h, Bool sizehints) { |
| 1266 | Monitor *m; | ||
| 1266 | XWindowChanges wc; | 1267 | XWindowChanges wc; |
| 1267 | //Monitor scr = monitors[monitorat()]; | 1268 | |
| 1268 | // c->monitor = monitorat(); | 1269 | m = &monitors[c->monitor]; |
| 1269 | 1270 | ||
| 1270 | if(sizehints) { | 1271 | if(sizehints) { |
| 1271 | /* set minimum possible */ | 1272 | /* set minimum possible */ |
| @@ -1307,17 +1308,14 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | |||
| 1307 | } | 1308 | } |
| 1308 | if(w <= 0 || h <= 0) | 1309 | if(w <= 0 || h <= 0) |
| 1309 | return; | 1310 | return; |
| 1310 | /* TODO: offscreen appearance fixes */ | 1311 | if(x > m->sw) |
| 1311 | /* | 1312 | x = m->sw - w - 2 * c->border; |
| 1312 | if(x > scr.sw) | 1313 | if(y > m->sh) |
| 1313 | x = scr.sw - w - 2 * c->border; | 1314 | y = m->sh - h - 2 * c->border; |
| 1314 | if(y > scr.sh) | 1315 | if(x + w + 2 * c->border < m->sx) |
| 1315 | y = scr.sh - h - 2 * c->border; | 1316 | x = m->sx; |
| 1316 | if(x + w + 2 * c->border < scr.sx) | 1317 | if(y + h + 2 * c->border < m->sy) |
| 1317 | x = scr.sx; | 1318 | y = m->sy; |
| 1318 | if(y + h + 2 * c->border < scr.sy) | ||
| 1319 | y = scr.sy; | ||
| 1320 | */ | ||
| 1321 | if(c->x != x || c->y != y || c->w != w || c->h != h) { | 1319 | if(c->x != x || c->y != y || c->w != w || c->h != h) { |
| 1322 | c->x = wc.x = x; | 1320 | c->x = wc.x = x; |
| 1323 | c->y = wc.y = y; | 1321 | c->y = wc.y = y; |
