aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartynas2009-02-03 22:20:31 +0000
committermartynas2009-02-03 22:20:31 +0000
commit5f45e57fdfb689d03b0e5a4080e2b8677e9d9bd1 (patch)
treec81a882e3ad0df2c20862fafc39e9a20eda43e36
parent8ff848ad4f7fdf4e83afd1b8ee3d372cf23786e9 (diff)
downloadcwm-5f45e57fdfb689d03b0e5a4080e2b8677e9d9bd1.tar.gz
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@
Diffstat (limited to '')
-rw-r--r--kbfunc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kbfunc.c b/kbfunc.c
index a98725e..1be5a80 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: kbfunc.c,v 1.34 2009/01/23 18:58:40 oga Exp $
+ * $Id: kbfunc.c,v 1.35 2009/02/03 22:20:31 martynas Exp $
*/
#include <paths.h>
@@ -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);