about summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2013-05-29 22:37:37 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2013-05-29 22:41:51 +0200
commit5515a365ba77cec3e7bf9797c3a4cc5e6c5c91ae (patch)
tree437f902828ef965474a0bcf9402f30bf937135cb /kbfunc.c
parent843f18aaee1550344b8521d95d952502e064c5f0 (diff)
parent692d341dfc6b059db570356e9dfadba92dc93f19 (diff)
downloadcwm-5515a365ba77cec3e7bf9797c3a4cc5e6c5c91ae.tar.gz
cwm-5515a365ba77cec3e7bf9797c3a4cc5e6c5c91ae.tar.xz
cwm-5515a365ba77cec3e7bf9797c3a4cc5e6c5c91ae.zip
cvsimport
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/kbfunc.c b/kbfunc.c
index bec81a4..37b8af7 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -88,17 +88,16 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
 	}
 	switch (flags & TYPEMASK) {
 	case CWM_MOVE:
-		cc->geom.y += my;
-		if (cc->geom.y + cc->geom.h < 0)
-			cc->geom.y = -cc->geom.h;
-		if (cc->geom.y > sc->view.h - 1)
-			cc->geom.y = sc->view.h - 1;
-
 		cc->geom.x += mx;
 		if (cc->geom.x + cc->geom.w < 0)
 			cc->geom.x = -cc->geom.w;
 		if (cc->geom.x > sc->view.w - 1)
 			cc->geom.x = sc->view.w - 1;
+		cc->geom.y += my;
+		if (cc->geom.y + cc->geom.h < 0)
+			cc->geom.y = -cc->geom.h;
+		if (cc->geom.y > sc->view.h - 1)
+			cc->geom.y = sc->view.h - 1;
 
 		cc->geom.x += client_snapcalc(cc->geom.x,
 		    cc->geom.x + cc->geom.w + (cc->bwidth * 2),
@@ -109,15 +108,15 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
 
 		client_move(cc);
 		xu_ptr_getpos(cc->win, &x, &y);
-		cc->ptr.y = y + my;
 		cc->ptr.x = x + mx;
+		cc->ptr.y = y + my;
 		client_ptrwarp(cc);
 		break;
 	case CWM_RESIZE:
-		if ((cc->geom.h += my) < 1)
-			cc->geom.h = 1;
 		if ((cc->geom.w += mx) < 1)
 			cc->geom.w = 1;
+		if ((cc->geom.h += my) < 1)
+			cc->geom.h = 1;
 		client_resize(cc, 1);
 
 		/* Make sure the pointer stays within the window. */