diff options
author | okan | 2013-05-11 22:03:17 +0000 |
---|---|---|
committer | okan | 2013-05-11 22:03:17 +0000 |
commit | f33b33868923e469c45b593d6699ed2f297daf3b (patch) | |
tree | 452bbe6052d994d07f6e6bccced6cd25fe64802b | |
parent | c10f247fe2e763d3a27fa7c71afcbeee388da4ec (diff) | |
download | cwm-f33b33868923e469c45b593d6699ed2f297daf3b.tar.gz |
swap x/y calculations in kbd move/resize to match those in the respective mouse functions
-rw-r--r-- | kbfunc.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -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. * - * $OpenBSD: kbfunc.c,v 1.77 2013/04/08 13:02:31 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.78 2013/05/11 22:03:17 okan Exp $ */ #include <sys/param.h> @@ -88,17 +88,16 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg) } switch (flags & TYPEMASK) { case CWM_MOVE: - cc->geom.y += my; - if (cc->geom.y + cc->geom.h < 0) - cc->geom.y = -cc->geom.h; - if (cc->geom.y > sc->view.h - 1) - cc->geom.y = sc->view.h - 1; - cc->geom.x += mx; if (cc->geom.x + cc->geom.w < 0) cc->geom.x = -cc->geom.w; if (cc->geom.x > sc->view.w - 1) cc->geom.x = sc->view.w - 1; + cc->geom.y += my; + if (cc->geom.y + cc->geom.h < 0) + cc->geom.y = -cc->geom.h; + if (cc->geom.y > sc->view.h - 1) + cc->geom.y = sc->view.h - 1; cc->geom.x += client_snapcalc(cc->geom.x, cc->geom.x + cc->geom.w + (cc->bwidth * 2), @@ -109,15 +108,15 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg) client_move(cc); xu_ptr_getpos(cc->win, &x, &y); - cc->ptr.y = y + my; cc->ptr.x = x + mx; + cc->ptr.y = y + my; client_ptrwarp(cc); break; case CWM_RESIZE: - if ((cc->geom.h += my) < 1) - cc->geom.h = 1; if ((cc->geom.w += mx) < 1) cc->geom.w = 1; + if ((cc->geom.h += my) < 1) + cc->geom.h = 1; client_resize(cc, 1); /* Make sure the pointer stays within the window. */ |