#define IS_FLOATING(c) (c->state == STATE_FLOATING)
#define IS_FULLSCREEN(c) (c->state == STATE_FULLSCREEN)
#define IS_RECEPTACLE(n) (is_leaf(n) && n->client == NULL)
-#define IS_MONOCLE(d) (d->layout == LAYOUT_MONOCLE || (single_monocle && tiled_count(d->root) <= 1))
+#define IS_MONOCLE(d) (d->layout == LAYOUT_MONOCLE || (single_monocle && tiled_count(d->root, true) <= 1))
#define BOOL_STR(A) ((A) ? "true" : "false")
#define ON_OFF_STR(A) ((A) ? "on" : "off")
layout_t l = d->layout;
- if (single_monocle && tiled_count(d->root) <= 1) {
+ if (single_monocle && tiled_count(d->root, true) <= 1) {
l = LAYOUT_MONOCLE;
}
return area(get_rectangle(NULL, d, n));
}
-int tiled_count(node_t *n)
+int tiled_count(node_t *n, bool include_receptacles)
{
if (n == NULL) {
return 0;
}
int cnt = 0;
for (node_t *f = first_extrema(n); f != NULL; f = next_leaf(f, n)) {
- if (!f->hidden && f->client != NULL && IS_TILED(f->client)) {
+ if (!f->hidden && ((include_receptacles && f->client == NULL) ||
+ (f->client != NULL && IS_TILED(f->client)))) {
cnt++;
}
}
void circulate_leaves(monitor_t *m, desktop_t *d, node_t *n, circulate_dir_t dir)
{
- if (tiled_count(n) < 2) {
+ if (tiled_count(n, false) < 2) {
return;
}
node_t *p = d->focus->parent;
bool find_any_node_in(monitor_t *m, desktop_t *d, node_t *n, coordinates_t *ref, coordinates_t *dst, node_select_t *sel);
void find_nearest_neighbor(coordinates_t *ref, coordinates_t *dst, direction_t dir, node_select_t *sel);
unsigned int node_area(desktop_t *d, node_t *n);
-int tiled_count(node_t *n);
+int tiled_count(node_t *n, bool include_receptacles);
void find_by_area(area_peak_t ap, coordinates_t *ref, coordinates_t *dst, node_select_t *sel);
void rotate_tree(node_t *n, int deg);
void rotate_tree_rec(node_t *n, int deg);