summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-02-20 08:13:41 +0000
committerAnselm R Garbe <garbeam@gmail.com>2008-02-20 08:13:41 +0000
commite0f039789643381485dab5c467f66db5162d4f63 (patch)
tree6c43539e190efe07746803d47edc66cbd9c73ce2
parentapplied some necessary changes (diff)
downloaddwm-e0f039789643381485dab5c467f66db5162d4f63.tar.gz
dwm-e0f039789643381485dab5c467f66db5162d4f63.zip
resize handles offscreen issues
-rw-r--r--dwm.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/dwm.c b/dwm.c
index 0a1ade2..363c202 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1263,9 +1263,10 @@ reapply(const char *arg) {
1263 1263
1264void 1264void
1265resize(Client *c, int x, int y, int w, int h, Bool sizehints) { 1265resize(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;