aboutsummaryrefslogtreecommitdiffstats
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan2008-06-12 18:32:06 +0000
committerokan2008-06-12 18:32:06 +0000
commit6c0b80a21fe472dddaa1224b1f775b9dfdb161c7 (patch)
treee285fc1205faea6c8fd9a2f5e8c101ead14a4786 /kbfunc.c
parentec170a7d8ceafeac794552f321d8f7d94b8be6a7 (diff)
downloadcwm-6c0b80a21fe472dddaa1224b1f775b9dfdb161c7.tar.gz
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 '')
-rw-r--r--kbfunc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 683da5f..b3e39c1 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: kbfunc.c,v 1.28 2008/05/20 14:50:51 oga Exp $
+ * $Id: kbfunc.c,v 1.29 2008/06/12 18:32:06 okan Exp $
*/
#include <paths.h>
@@ -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: