recttoclient.c (326B)
1 Client * 2 recttoclient(int x, int y, int w, int h, int include_floating) 3 { 4 Client *c, *r = NULL; 5 int a, area = 1; 6 7 for (c = selmon->stack; c; c = c->snext) { 8 if (!ISVISIBLE(c) || (c->isfloating && !include_floating)) 9 continue; 10 if ((a = INTERSECTC(x, y, w, h, c)) >= area) { 11 area = a; 12 r = c; 13 } 14 } 15 return r; 16 }