summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2015-11-10 22:06:57 +0000
committerokan <okan>2015-11-10 22:06:57 +0000
commit09565bc42362bb3a9fd24c75441e89c723114364 (patch)
tree588bb44d6b9f863d91d033eb984270e14676ad20 /kbfunc.c
parente20110f3445ba7f388482f5be7b72a922e548c92 (diff)
downloadcwm-09565bc42362bb3a9fd24c75441e89c723114364.tar.gz
cwm-09565bc42362bb3a9fd24c75441e89c723114364.tar.xz
cwm-09565bc42362bb3a9fd24c75441e89c723114364.zip
Use position on root to figure out region.
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 19be227..1bf311c 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -101,9 +101,8 @@ kbfunc_client_moveresize(struct client_ctx *cc, union arg *arg)
 		if (cc->geom.y > sc->view.h - 1)
 			cc->geom.y = sc->view.h - 1;
 
-		rc = region_find(sc,
-		    cc->geom.x + cc->geom.w / 2,
-		    cc->geom.y + cc->geom.h / 2);
+		xu_ptr_getpos(cc->win, &x, &y);
+		rc = region_find(sc, x + 1, y + 1);
 		cc->geom.x += client_snapcalc(cc->geom.x,
 		    cc->geom.x + cc->geom.w + (cc->bwidth * 2),
 		    rc->work.x, rc->work.x + rc->work.w, sc->snapdist);