diff options
author | okan <okan> | 2008-06-12 18:32:06 +0000 |
---|---|---|
committer | okan <okan> | 2008-06-12 18:32:06 +0000 |
commit | 198bb381a96c14aec2b542879f966a53992c8184 (patch) | |
tree | 5620db39ff99d30ca09217486b6a5e622f3f20fd /grab.c | |
parent | 6f1f3592d4c93d625b37d0f9842ab32a78766c7b (diff) | |
download | cwm-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 'grab.c')
-rw-r--r-- | grab.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/grab.c b/grab.c index 6249c2b..eb3abd8 100644 --- a/grab.c +++ b/grab.c @@ -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; } |