dwm-meillo

diff event.c @ 551:798b906378d6

added screen-border snapping in floating mode, feels quite well
author arg@mig29
date Mon, 30 Oct 2006 11:58:05 +0100
parents 787f6ae02f29
children 98a0d10e9918
line diff
     1.1 --- a/event.c	Fri Oct 27 13:29:35 2006 +0200
     1.2 +++ b/event.c	Mon Oct 30 11:58:05 2006 +0100
     1.3 @@ -48,6 +48,14 @@
     1.4  			XSync(dpy, False);
     1.5  			c->x = ocx + (ev.xmotion.x - x1);
     1.6  			c->y = ocy + (ev.xmotion.y - y1);
     1.7 +			if(abs(c->x) < sx + SNAP)
     1.8 +				c->x = sx;
     1.9 +			if(abs(c->y) < sy + bh + SNAP)
    1.10 +				c->y = sy + bh;
    1.11 +			if(abs(c->x + c->w) > sx + sw - SNAP)
    1.12 +				c->x = sw - c->w - 2 * BORDERPX;
    1.13 +			if(abs(c->y + c->h) > sy + sh - SNAP)
    1.14 +				c->y = sh - c->h - 2 * BORDERPX;
    1.15  			resize(c, False, TopLeft);
    1.16  			break;
    1.17  		}