summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2015-11-09 20:03:29 +0000
committerokan <okan>2015-11-09 20:03:29 +0000
commitd7bd2998191af2ce1d6c0018e7c3a43a01ed3be5 (patch)
treef19e680cf0d8ca985fe18f66a39e273677676162 /kbfunc.c
parent5fcf2516721dd441b435ba07f73c6315c104f5a3 (diff)
downloadcwm-d7bd2998191af2ce1d6c0018e7c3a43a01ed3be5.tar.gz
cwm-d7bd2998191af2ce1d6c0018e7c3a43a01ed3be5.tar.xz
cwm-d7bd2998191af2ce1d6c0018e7c3a43a01ed3be5.zip
Extend region to include both view and work areas; switch to
region_find() which no longer needs to recalculate gap each time
a client (or menu) is created or altered. If no RandR, fall back
to display dimensions while building regions instead of during
execution.
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kbfunc.c b/kbfunc.c
index d8cc265..8e9702e 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 geom		 area;
+	struct region_ctx	*rc;
 	int			 x, y, flags, amt;
 	unsigned int		 mx, my;
 
@@ -101,15 +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;
 
-		area = screen_area(sc,
+		rc = region_find(sc,
 		    cc->geom.x + cc->geom.w / 2,
-		    cc->geom.y + cc->geom.h / 2, CWM_GAP);
+		    cc->geom.y + cc->geom.h / 2);
 		cc->geom.x += client_snapcalc(cc->geom.x,
 		    cc->geom.x + cc->geom.w + (cc->bwidth * 2),
-		    area.x, area.x + area.w, sc->snapdist);
+		    rc->work.x, rc->work.x + rc->work.w, sc->snapdist);
 		cc->geom.y += client_snapcalc(cc->geom.y,
 		    cc->geom.y + cc->geom.h + (cc->bwidth * 2),
-		    area.y, area.y + area.h, sc->snapdist);
+		    rc->work.y, rc->work.y + rc->work.h, sc->snapdist);
 
 		client_move(cc);
 		xu_ptr_getpos(cc->win, &x, &y);