+
+ for (d = 0; d < screen_num_desktops; ++d) {
+ if (d != desktop && desktop != DESKTOP_ALL) continue;
+
+ for (i = 0; i < screen_num_monitors; ++i) {
+ if (head != SCREEN_AREA_ALL_MONITORS && head != i) continue;
+
+ for (it = struts_left[d]; it; it = g_slist_next(it)) {
+ StrutPartial *s = it->data;
+ if (STRUT_LEFT_IN_SEARCH(s, search) &&
+ !STRUT_LEFT_IGNORE(s, us, search))
+ l = MAX(l, al + s->left);
+ }
+ for (it = struts_top[d]; it; it = g_slist_next(it)) {
+ StrutPartial *s = it->data;
+ if (STRUT_TOP_IN_SEARCH(s, search) &&
+ !STRUT_TOP_IGNORE(s, us, search))
+ t = MAX(t, al + s->top);
+ }
+ for (it = struts_right[d]; it; it = g_slist_next(it)) {
+ StrutPartial *s = it->data;
+ if (STRUT_RIGHT_IN_SEARCH(s, search) &&
+ !STRUT_RIGHT_IGNORE(s, us, search))
+ r = MIN(r, ar - s->right);
+ }
+ for (it = struts_bottom[d]; it; it = g_slist_next(it)) {
+ StrutPartial *s = it->data;
+ if (STRUT_BOTTOM_IN_SEARCH(s, search) &&
+ !STRUT_BOTTOM_IGNORE(s, us, search))
+ r = MIN(r, ar - s->bottom);
+ }
+
+ /* limit to this monitor */
+ if (head == i) {
+ l = MAX(l, RECT_LEFT(monitor_area[i]));
+ t = MAX(t, RECT_TOP(monitor_area[i]));
+ r = MIN(r, RECT_RIGHT(monitor_area[i]));
+ b = MIN(b, RECT_BOTTOM(monitor_area[i]));
+ }
+ }