aboutsummaryrefslogtreecommitdiffstats
path: root/grab.c
diff options
context:
space:
mode:
authorokan2008-06-12 18:32:06 +0000
committerokan2008-06-12 18:32:06 +0000
commit6c0b80a21fe472dddaa1224b1f775b9dfdb161c7 (patch)
treee285fc1205faea6c8fd9a2f5e8c101ead14a4786 /grab.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--grab.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/grab.c b/grab.c
index 6a25e88..acd413f 100644
--- a/grab.c
+++ b/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;
}