summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2015-11-11 14:22:01 +0000
committerokan <okan>2015-11-11 14:22:01 +0000
commit00bdd48b1d93b91946c7655ec8829060040aec22 (patch)
tree97a1ef802671b187c9566744ef04cacd9d3e65e1 /kbfunc.c
parent09565bc42362bb3a9fd24c75441e89c723114364 (diff)
downloadcwm-00bdd48b1d93b91946c7655ec8829060040aec22.tar.gz
cwm-00bdd48b1d93b91946c7655ec8829060040aec22.tar.xz
cwm-00bdd48b1d93b91946c7655ec8829060040aec22.zip
Partial revert of replacing screen_area() with region_find(); until a
fix for a regression is found; this bug has been around for a long time
it seems, but this change exposed it. Likely need to track clients in to
and out of regions.
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 1bf311c..8e2f579 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -57,7 +57,7 @@ void
 kbfunc_client_moveresize(struct client_ctx *cc, union arg *arg)
 {
 	struct screen_ctx	*sc = cc->sc;
-	struct region_ctx	*rc;
+	struct geom		 area;
 	int			 x, y, flags, amt;
 	unsigned int		 mx, my;
 
@@ -101,14 +101,15 @@ 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;
 
-		xu_ptr_getpos(cc->win, &x, &y);
-		rc = region_find(sc, x + 1, y + 1);
+		area = screen_area(sc,
+		    cc->geom.x + cc->geom.w / 2,
+		    cc->geom.y + cc->geom.h / 2, CWM_GAP);
 		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);
+		    area.x, area.x + area.w, sc->snapdist);
 		cc->geom.y += client_snapcalc(cc->geom.y,
 		    cc->geom.y + cc->geom.h + (cc->bwidth * 2),
-		    rc->work.y, rc->work.y + rc->work.h, sc->snapdist);
+		    area.y, area.y + area.h, sc->snapdist);
 
 		client_move(cc);
 		xu_ptr_getpos(cc->win, &x, &y);