mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
swap x/y calculations in kbd move/resize to match those in the respective mouse functions
This commit is contained in:
parent
2b926784ba
commit
112f616d1d
17
kbfunc.c
17
kbfunc.c
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user