mirror of
https://github.com/tmux/tmux.git
synced 2026-06-04 00:56:17 +00:00
Merge branch 'master' into floating_panes
This commit is contained in:
49
layout.c
49
layout.c
@@ -91,19 +91,6 @@ layout_free_cell(struct layout_cell *lc)
|
||||
layout_free_cell(lcchild);
|
||||
}
|
||||
break;
|
||||
case LAYOUT_FLOATING:
|
||||
/*
|
||||
* A floating layout cell is only used temporarily while
|
||||
* select-layout constructs a layout. Remove the children from
|
||||
* the temporary layout, then free temporary floating layout
|
||||
* cell. Each floating pane has stub layout.
|
||||
*/
|
||||
while (!TAILQ_EMPTY(&lc->cells)) {
|
||||
lcchild = TAILQ_FIRST(&lc->cells);
|
||||
TAILQ_REMOVE(&lc->cells, lcchild, entry);
|
||||
lcchild->parent = NULL;
|
||||
}
|
||||
break;
|
||||
case LAYOUT_WINDOWPANE:
|
||||
if (lc->wp != NULL) {
|
||||
lc->wp->layout_cell->parent = NULL;
|
||||
@@ -132,9 +119,6 @@ layout_print_cell(struct layout_cell *lc, const char *hdr, u_int n)
|
||||
case LAYOUT_TOPBOTTOM:
|
||||
type = "TOPBOTTOM";
|
||||
break;
|
||||
case LAYOUT_FLOATING:
|
||||
type = "FLOATING";
|
||||
break;
|
||||
case LAYOUT_WINDOWPANE:
|
||||
type = "WINDOWPANE";
|
||||
break;
|
||||
@@ -148,7 +132,6 @@ layout_print_cell(struct layout_cell *lc, const char *hdr, u_int n)
|
||||
switch (lc->type) {
|
||||
case LAYOUT_LEFTRIGHT:
|
||||
case LAYOUT_TOPBOTTOM:
|
||||
case LAYOUT_FLOATING:
|
||||
TAILQ_FOREACH(lcchild, &lc->cells, entry)
|
||||
layout_print_cell(lcchild, hdr, n + 1);
|
||||
break;
|
||||
@@ -189,7 +172,6 @@ layout_search_by_border(struct layout_cell *lc, u_int x, u_int y)
|
||||
return (last);
|
||||
break;
|
||||
case LAYOUT_WINDOWPANE:
|
||||
case LAYOUT_FLOATING:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -252,7 +234,6 @@ layout_fix_zindexes(struct window *w, struct layout_cell *lc)
|
||||
break;
|
||||
case LAYOUT_LEFTRIGHT:
|
||||
case LAYOUT_TOPBOTTOM:
|
||||
case LAYOUT_FLOATING:
|
||||
TAILQ_FOREACH(lcchild, &lc->cells, entry)
|
||||
layout_fix_zindexes(w, lcchild);
|
||||
return;
|
||||
@@ -429,7 +410,6 @@ layout_count_cells(struct layout_cell *lc)
|
||||
return (1);
|
||||
case LAYOUT_LEFTRIGHT:
|
||||
case LAYOUT_TOPBOTTOM:
|
||||
case LAYOUT_FLOATING:
|
||||
TAILQ_FOREACH(lcchild, &lc->cells, entry)
|
||||
count += layout_count_cells(lcchild);
|
||||
return (count);
|
||||
@@ -646,26 +626,15 @@ layout_destroy_cell(struct window *w, struct layout_cell *lc,
|
||||
return;
|
||||
}
|
||||
|
||||
/* A floating cell need only be removed from the parent. */
|
||||
if (lcparent->type == LAYOUT_FLOATING) {
|
||||
TAILQ_REMOVE(&lcparent->cells, lc, entry);
|
||||
layout_free_cell(lc);
|
||||
return;
|
||||
}
|
||||
|
||||
/* In tiled layouts, merge the space into the previous or next cell. */
|
||||
if (lcparent->type != LAYOUT_FLOATING) {
|
||||
is_hidden = (lc->wp != NULL && (lc->wp->flags & PANE_HIDDEN));
|
||||
direction = (lc == TAILQ_FIRST(&lcparent->cells)) ? 1 : 0;
|
||||
lcother = layout_active_neighbour(lc, direction);
|
||||
if (lcother == NULL)
|
||||
lcother = layout_active_neighbour(lc, !direction);
|
||||
if (lcother != NULL && lcparent->type == LAYOUT_LEFTRIGHT &&
|
||||
!is_hidden)
|
||||
layout_resize_adjust(w, lcother, lcparent->type, lc->sx + 1);
|
||||
else if (lcother != NULL && !is_hidden)
|
||||
layout_resize_adjust(w, lcother, lcparent->type, lc->sy + 1);
|
||||
}
|
||||
/* Merge the space into the previous or next cell. */
|
||||
if (lc == TAILQ_FIRST(&lcparent->cells))
|
||||
lcother = TAILQ_NEXT(lc, entry);
|
||||
else
|
||||
lcother = TAILQ_PREV(lc, layout_cells, entry);
|
||||
if (lcother != NULL && lcparent->type == LAYOUT_LEFTRIGHT)
|
||||
layout_resize_adjust(w, lcother, lcparent->type, lc->sx + 1);
|
||||
else if (lcother != NULL)
|
||||
layout_resize_adjust(w, lcother, lcparent->type, lc->sy + 1);
|
||||
|
||||
/* Remove this from the parent's list. */
|
||||
TAILQ_REMOVE(&lcparent->cells, lc, entry);
|
||||
|
||||
Reference in New Issue
Block a user