introduce a new config option to snap to the screen edge. 'snapdist'

keyword taken from a diff from Sviatoslav Chagaev to do the same thing,
but implemented in a completely way (based on some very old code from
mk@).  default set to 0, so no behavior change.

ok oga@ (who would also like to take it further...)
This commit is contained in:
okan
2011-06-24 06:06:24 +00:00
parent b230e611be
commit 34ba6cdbcc
7 changed files with 56 additions and 2 deletions

View File

@ -100,6 +100,13 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg)
if (cc->geom.x > cc->sc->xmax - 1)
cc->geom.x = cc->sc->xmax - 1;
cc->geom.x += client_snapcalc(cc->geom.x,
cc->geom.width, cc->sc->xmax,
cc->bwidth, Conf.snapdist);
cc->geom.y += client_snapcalc(cc->geom.y,
cc->geom.height, cc->sc->ymax,
cc->bwidth, Conf.snapdist);
client_move(cc);
xu_ptr_getpos(cc->win, &x, &y);
cc->ptr.y = y + my;