summary refs log tree commit diff
path: root/mousefunc.c
diff options
context:
space:
mode:
authorokan <okan>2013-01-02 21:37:21 +0000
committerokan <okan>2013-01-02 21:37:21 +0000
commit2ac65bd2882c26dc4dddac26d1883dd140704fef (patch)
tree738d18d60e9e4a87b51bfebdd281638595800c63 /mousefunc.c
parent6e5dda99a62cb659d30cdb6a59478a042fb485ed (diff)
downloadcwm-2ac65bd2882c26dc4dddac26d1883dd140704fef.tar.gz
cwm-2ac65bd2882c26dc4dddac26d1883dd140704fef.tar.xz
cwm-2ac65bd2882c26dc4dddac26d1883dd140704fef.zip
re-work client_snapcalc() so it takes client and edge dimensions with
snapdist; allows for simplier snap calculations.

required for an upcoming diff for honoring gap.
Diffstat (limited to 'mousefunc.c')
-rw-r--r--mousefunc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mousefunc.c b/mousefunc.c
index eb5171a..1b207ce 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -162,11 +162,11 @@ mousefunc_window_move(struct client_ctx *cc, void *arg)
 			cc->geom.y = ev.xmotion.y_root - py - cc->bwidth;
 
 			cc->geom.x += client_snapcalc(cc->geom.x,
-			    cc->geom.w, sc->view.w,
-			    cc->bwidth, Conf.snapdist);
+			    cc->geom.x + cc->geom.w + (cc->bwidth * 2),
+			    sc->view.x, sc->view.w, Conf.snapdist);
 			cc->geom.y += client_snapcalc(cc->geom.y,
-			    cc->geom.h, sc->view.h,
-			    cc->bwidth, Conf.snapdist);
+			    cc->geom.y + cc->geom.h + (cc->bwidth * 2),
+			    sc->view.y, sc->view.h, Conf.snapdist);
 
 			/* don't move more than 60 times / second */
 			if ((ev.xmotion.time - ltime) > (1000 / 60)) {