all repos — dwm @ b6614261ea48c9711cefd79601e09fa764ee3075

my dwm build

added screen-border snapping in floating mode, feels quite well
arg@mig29 unknown
Mon, 30 Oct 2006 11:58:05 +0100
commit

b6614261ea48c9711cefd79601e09fa764ee3075

parent

91e569ca37ac441930f041057d2934f02bf263a2

3 files changed, 10 insertions(+), 0 deletions(-)

jump to
M config.arg.hconfig.arg.h

@@ -19,6 +19,7 @@ #define STATUSFGCOLOR "#9999cc"

#define MASTER 600 /* per thousand */ #define MODKEY Mod1Mask +#define SNAP 20 /* pixel */ #define KEYS \ static Key key[] = { \
M config.default.hconfig.default.h

@@ -19,6 +19,7 @@ #define STATUSFGCOLOR "#222222"

#define MASTER 600 /* per thousand */ #define MODKEY Mod1Mask +#define SNAP 20 /* pixel */ #define KEYS \ static Key key[] = { \
M event.cevent.c

@@ -48,6 +48,14 @@ case MotionNotify:

XSync(dpy, False); c->x = ocx + (ev.xmotion.x - x1); c->y = ocy + (ev.xmotion.y - y1); + if(abs(c->x) < sx + SNAP) + c->x = sx; + if(abs(c->y) < sy + bh + SNAP) + c->y = sy + bh; + if(abs(c->x + c->w) > sx + sw - SNAP) + c->x = sw - c->w - 2 * BORDERPX; + if(abs(c->y + c->h) > sy + sh - SNAP) + c->y = sh - c->h - 2 * BORDERPX; resize(c, False, TopLeft); break; }