mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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@
This commit is contained in:
parent
6f1f3592d4
commit
198bb381a9
9
grab.c
9
grab.c
@ -100,9 +100,14 @@ grab_sweep(struct client_ctx *cc)
|
|||||||
XUnmapWindow(X_Dpy, sc->menuwin);
|
XUnmapWindow(X_Dpy, sc->menuwin);
|
||||||
XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
|
XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
|
||||||
xu_ptr_ungrab();
|
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_ptrwarp(cc);
|
||||||
|
|
||||||
client_do_shape(cc);
|
client_do_shape(cc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
12
kbfunc.c
12
kbfunc.c
@ -89,12 +89,12 @@ kbfunc_moveresize(struct client_ctx *cc, void *arg)
|
|||||||
cc->geom.width += mx;
|
cc->geom.width += mx;
|
||||||
client_resize(cc);
|
client_resize(cc);
|
||||||
|
|
||||||
/*
|
/* Make sure the pointer stays within the window. */
|
||||||
* Moving the cursor while resizing is problematic. Just place
|
xu_ptr_getpos(cc->pwin, &cc->ptr.x, &cc->ptr.y);
|
||||||
* it in the middle of the window.
|
if (cc->ptr.x > cc->geom.width)
|
||||||
*/
|
cc->ptr.x = cc->geom.width - cc->bwidth;
|
||||||
cc->ptr.x = -1;
|
if (cc->ptr.y > cc->geom.height)
|
||||||
cc->ptr.y = -1;
|
cc->ptr.y = cc->geom.height - cc->bwidth;
|
||||||
client_ptrwarp(cc);
|
client_ptrwarp(cc);
|
||||||
break;
|
break;
|
||||||
case CWM_PTRMOVE:
|
case CWM_PTRMOVE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user