n->rectangle = rect;
- if (pointer_follows_focus && mon->desk->focus == n) {
- xcb_rectangle_t r = rect;
- r.width -= d->window_gap;
- r.height -= d->window_gap;
- center_pointer(r);
- }
-
if (n->presel != NULL) {
draw_presel_feedback(m, d, n);
}
first_rect = second_rect = rect;
} else {
unsigned int fence;
- if (auto_split_type) {
- n->split_type = n->rectangle.width > n->rectangle.height ? TYPE_VERTICAL : TYPE_HORIZONTAL;
- }
if (n->split_type == TYPE_VERTICAL) {
fence = rect.width * n->split_ratio;
if ((n->first_child->constraints.min_width + n->second_child->constraints.min_width) <= rect.width) {
}
n->parent = c;
if (f->presel == NULL) {
- if (p == NULL || automatic_scheme == SCHEME_LONGEST_SIDE || (f->client != NULL && IS_TILED(f->client) && tiled_count(d->root, true) == 1)) {
+ bool single_tiled = f->client != NULL && IS_TILED(f->client) && tiled_count(d->root, true) == 1;
+ if (p == NULL || automatic_scheme != SCHEME_SPIRAL || single_tiled) {
if (p != NULL) {
if (is_first_child(f)) {
p->first_child = c;
c->first_child = f;
c->second_child = n;
}
- if (f->rectangle.width > f->rectangle.height) {
- c->split_type = TYPE_VERTICAL;
+ if (p == NULL || automatic_scheme == SCHEME_LONGEST_SIDE || single_tiled) {
+ if (f->rectangle.width > f->rectangle.height) {
+ c->split_type = TYPE_VERTICAL;
+ } else {
+ c->split_type = TYPE_HORIZONTAL;
+ }
} else {
- c->split_type = TYPE_HORIZONTAL;
+ if (p->split_type == TYPE_HORIZONTAL) {
+ c->split_type = TYPE_VERTICAL;
+ } else {
+ c->split_type = TYPE_HORIZONTAL;
+ }
}
} else {
node_t *g = p->parent;
d->root = b;
}
+ if (!n->vacant && removal_adjustment) {
+ if (automatic_scheme == SCHEME_LONGEST_SIDE || g == NULL) {
+ if (p != NULL) {
+ if (p->rectangle.width > p->rectangle.height) {
+ b->split_type = TYPE_VERTICAL;
+ } else {
+ b->split_type = TYPE_HORIZONTAL;
+ }
+ }
+ } else if (automatic_scheme == SCHEME_ALTERNATE) {
+ if (g->split_type == TYPE_HORIZONTAL) {
+ b->split_type = TYPE_VERTICAL;
+ } else {
+ b->split_type = TYPE_HORIZONTAL;
+ }
+ }
+ }
+
free(p);
n->parent = NULL;
put_status(SBSC_MASK_REPORT);
}
-/* Returns true if a contains b */
-bool contains(xcb_rectangle_t a, xcb_rectangle_t b)
-{
- return (a.x <= b.x && (a.x + a.width) >= (b.x + b.width) &&
- a.y <= b.y && (a.y + a.height) >= (b.y + b.height));
-}
-
xcb_rectangle_t get_rectangle(monitor_t *m, desktop_t *d, node_t *n)
{
if (n == NULL) {