+ for (i = 0; i < screen_num_monitors; ++i) {
+ spaces = area_add(spaces, areas[i]);
+
+ /* stay out from under windows in higher layers */
+ for (it = stacking_list; it; it = g_list_next(it)) {
+ ObClient *c;
+
+ if (WINDOW_IS_CLIENT(it->data)) {
+ c = it->data;
+ if (c->fullscreen || (c->max_vert && c->max_horz))
+ continue;
+ } else
+ continue;
+
+ if (c->layer > client->layer) {
+ if (!SMART_IGNORE(client, c))
+ spaces = area_remove(spaces, &c->frame->area);
+ } else
+ break;
+ }
+
+ if (type == SMART_FULL || type == SMART_FOCUSED) {
+ gboolean found_foc = FALSE, stop = FALSE;
+ ObClient *foc;
+
+ foc = focus_order_find_first(client->desktop == DESKTOP_ALL ?
+ screen_desktop : client->desktop);
+
+ for (; it && !stop; it = g_list_next(it)) {
+ ObClient *c;
+
+ if (WINDOW_IS_CLIENT(it->data)) {
+ c = it->data;
+ if (c->fullscreen || (c->max_vert && c->max_horz))
+ continue;
+ } else
+ continue;
+
+ if (!SMART_IGNORE(client, c)) {
+ if (type == SMART_FOCUSED)
+ if (found_foc)
+ stop = TRUE;
+ if (!stop)
+ spaces = area_remove(spaces, &c->frame->area);
+ }