mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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:
7
kbfunc.c
7
kbfunc.c
@ -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;
|
||||
|
Reference in New Issue
Block a user