diff options
author | arg@mig29 <unknown> | 2006-10-30 11:58:05 +0100 |
---|---|---|
committer | arg@mig29 <unknown> | 2006-10-30 11:58:05 +0100 |
commit | b6614261ea48c9711cefd79601e09fa764ee3075 (patch) | |
tree | e45411abe4b58a8acea5e7f5d1a0b9b4ea855a06 /event.c | |
parent | 91e569ca37ac441930f041057d2934f02bf263a2 (diff) | |
download | dwm-b6614261ea48c9711cefd79601e09fa764ee3075.tar.gz |
added screen-border snapping in floating mode, feels quite well
Diffstat (limited to 'event.c')
-rw-r--r-- | event.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -48,6 +48,14 @@ movemouse(Client *c) { 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; } |