summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2008-06-12 18:32:06 +0000
committerokan <okan>2008-06-12 18:32:06 +0000
commit198bb381a96c14aec2b542879f966a53992c8184 (patch)
tree5620db39ff99d30ca09217486b6a5e622f3f20fd /kbfunc.c
parent6f1f3592d4c93d625b37d0f9842ab32a78766c7b (diff)
downloadcwm-198bb381a96c14aec2b542879f966a53992c8184.tar.gz
cwm-198bb381a96c14aec2b542879f966a53992c8184.tar.xz
cwm-198bb381a96c14aec2b542879f966a53992c8184.zip
instead of forcing the ptr in the middle everytime, be more 'calm'; keep
the ptr still unless it moves out-of-bounds, then just follow the edge.

brought up by todd@

ok oga@
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kbfunc.c b/kbfunc.c
index e006d34..f92efa1 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -89,12 +89,12 @@ kbfunc_moveresize(struct client_ctx *cc, void *arg)
 		cc->geom.width += mx;
 		client_resize(cc);
 
-		/*
-		 * Moving the cursor while resizing is problematic. Just place
-		 * it in the middle of the window.
-		 */
-		cc->ptr.x = -1;
-		cc->ptr.y = -1;
+		/* Make sure the pointer stays within the window. */
+		xu_ptr_getpos(cc->pwin, &cc->ptr.x, &cc->ptr.y);
+		if (cc->ptr.x > cc->geom.width)
+			cc->ptr.x = cc->geom.width - cc->bwidth;
+		if (cc->ptr.y > cc->geom.height)
+			cc->ptr.y = cc->geom.height - cc->bwidth;
 		client_ptrwarp(cc);
 		break;
 	case CWM_PTRMOVE: