6 static int resistance = 10;
8 void snap_move(Client *c, int *x, int *y, int w, int h)
12 int l, t, r, b; /* requested edges */
13 int al, at, ar, ab; /* screen area edges */
14 int cl, ct, cr, cb; /* current edges */
16 /* add the frame to the dimensions */
22 cl = c->frame->area.x;
23 ct = c->frame->area.y;
24 cr = cl + c->frame->area.width - 1;
25 cb = ct + c->frame->area.height - 1;
27 /* snap to other clients */
28 for (it = stacking_list; it != NULL; it = it->next) {
32 /* get the screen boundaries */
33 area = screen_area(c->desktop);
36 ar = al + area->width - 1;
37 ab = at + area->height - 1;
39 /* snap to screen edges */
40 if (cl >= al && l < al && l >= al - resistance)
42 else if (cr <= ar && r > ar && r <= ar + resistance)
44 if (ct >= at && t < at && t >= at - resistance)
46 else if (cb <= ab && b > ab && b < ab + resistance)