diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2008-06-12 18:32:07 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2008-06-12 18:32:07 +0000 |
commit | a3c00cbdb22fde3c808603d825a484aa2c39ce05 (patch) | |
tree | c773b85887a67dbaf4ea4c20b12ba537968c9dfd /app/cwm | |
parent | 388345fc66270b920a413ea4dbd8c75505498aff (diff) |
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 'app/cwm')
-rw-r--r-- | app/cwm/grab.c | 11 | ||||
-rw-r--r-- | app/cwm/kbfunc.c | 14 |
2 files changed, 15 insertions, 10 deletions
diff --git a/app/cwm/grab.c b/app/cwm/grab.c index 6a25e88ea..acd413f41 100644 --- a/app/cwm/grab.c +++ b/app/cwm/grab.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: grab.c,v 1.15 2008/06/12 05:10:24 okan Exp $ + * $Id: grab.c,v 1.16 2008/06/12 18:32:06 okan Exp $ */ #include "headers.h" @@ -100,9 +100,14 @@ grab_sweep(struct client_ctx *cc) XUnmapWindow(X_Dpy, sc->menuwin); XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0); xu_ptr_ungrab(); - cc->ptr.x = -1; - cc->ptr.y = -1; + + /* Make sure the pointer stays within the window. */ + 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); + client_do_shape(cc); return; } diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 683da5f0f..b3e39c103 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/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: |