diff options
author | okan <okan> | 2011-06-24 06:06:24 +0000 |
---|---|---|
committer | okan <okan> | 2011-06-24 06:06:24 +0000 |
commit | 34ba6cdbcc03111d75e2336739aa70edc7da5a1d (patch) | |
tree | a0d1ba0b07ab1606184abdf22ddf02849c2e6e46 /mousefunc.c | |
parent | b230e611beebcaab31379f2230b81ab4cf6b890a (diff) | |
download | cwm-34ba6cdbcc03111d75e2336739aa70edc7da5a1d.tar.gz cwm-34ba6cdbcc03111d75e2336739aa70edc7da5a1d.tar.xz cwm-34ba6cdbcc03111d75e2336739aa70edc7da5a1d.zip |
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...)
Diffstat (limited to 'mousefunc.c')
-rw-r--r-- | mousefunc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mousefunc.c b/mousefunc.c index 3050c31..d287d8b 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -160,6 +160,13 @@ mousefunc_window_move(struct client_ctx *cc, void *arg) cc->geom.x = ev.xmotion.x_root - px - cc->bwidth; cc->geom.y = ev.xmotion.y_root - py - cc->bwidth; + 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); + /* don't move more than 60 times / second */ if ((ev.xmotion.time - time) > (1000 / 60)) { time = ev.xmotion.time; |