summary refs log tree commit diff
diff options
context:
space:
mode:
authormartynas <martynas>2009-02-03 22:20:31 +0000
committermartynas <martynas>2009-02-03 22:20:31 +0000
commit4fe12f528c4774c7b14bc50382731ec3a6eb55cc (patch)
treee0d6e5550ccee8361381e1efb576184d26b52be7
parent6ad198022b7ccdcaba091827d6cef3be27bb8d87 (diff)
downloadcwm-4fe12f528c4774c7b14bc50382731ec3a6eb55cc.tar.gz
cwm-4fe12f528c4774c7b14bc50382731ec3a6eb55cc.tar.xz
cwm-4fe12f528c4774c7b14bc50382731ec3a6eb55cc.zip
fix off-by-one in geom.[xy], after pwin changes. keyboard movement
to the rightmost or bottommost corners would confuse cwm:
- there's no way to get the window back
- tab cycling breaks
ok okan@, oga@
-rw-r--r--kbfunc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 6437705..b063f2e 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -80,14 +80,14 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
 		cc->geom.y += my;
 		if (cc->geom.y + cc->geom.height < 0)
 			cc->geom.y = -cc->geom.height;
-		if (cc->geom.y > cc->sc->ymax)
-			cc->geom.y = cc->sc->ymax;
+		if (cc->geom.y > cc->sc->ymax - 1)
+			cc->geom.y = cc->sc->ymax - 1;
 
 		cc->geom.x += mx;
 		if (cc->geom.x + cc->geom.width < 0)
 			cc->geom.x = -cc->geom.width;
-		if (cc->geom.x > cc->sc->xmax)
-			cc->geom.x = cc->sc->xmax;
+		if (cc->geom.x > cc->sc->xmax - 1)
+			cc->geom.x = cc->sc->xmax - 1;
 
 		client_move(cc);
 		xu_ptr_getpos(cc->win, &x, &y);