mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Some more trivial floating panes bits.
This commit is contained in:
@@ -42,10 +42,10 @@ const struct cmd_entry cmd_new_pane_entry = {
|
|||||||
.args = { "bc:de:fF:hIkl:Lm:p:PR:s:S:t:vx:X:y:Y:Z", 0, -1, NULL },
|
.args = { "bc:de:fF:hIkl:Lm:p:PR:s:S:t:vx:X:y:Y:Z", 0, -1, NULL },
|
||||||
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
||||||
"[-F format] [-l size] [-m message] [-p percentage] "
|
"[-F format] [-l size] [-m message] [-p percentage] "
|
||||||
"[-s style] [-S active-border-style] "
|
"[-s style] [-S active-border-style] "
|
||||||
"[-R inactive-border-style] [-x width] [-y height] "
|
"[-R inactive-border-style] [-x width] [-y height] "
|
||||||
"[-X x-position] [-Y y-position] " CMD_TARGET_PANE_USAGE " "
|
"[-X x-position] [-Y y-position] " CMD_TARGET_PANE_USAGE " "
|
||||||
"[shell-command [argument ...]]",
|
"[shell-command [argument ...]]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
|
||||||
@@ -60,9 +60,9 @@ const struct cmd_entry cmd_split_window_entry = {
|
|||||||
.args = { "bc:de:fF:hIkl:m:p:PR:s:S:t:vZ", 0, -1, NULL },
|
.args = { "bc:de:fF:hIkl:m:p:PR:s:S:t:vZ", 0, -1, NULL },
|
||||||
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
|
||||||
"[-F format] [-l size] [-m message] [-p percentage] "
|
"[-F format] [-l size] [-m message] [-p percentage] "
|
||||||
"[-s style] [-S active-border-style] "
|
"[-s style] [-S active-border-style] "
|
||||||
"[-R inactive-border-style] " CMD_TARGET_PANE_USAGE " "
|
"[-R inactive-border-style] " CMD_TARGET_PANE_USAGE " "
|
||||||
"[shell-command [argument ...]]",
|
"[shell-command [argument ...]]",
|
||||||
|
|
||||||
.target = { 't', CMD_FIND_PANE, 0 },
|
.target = { 't', CMD_FIND_PANE, 0 },
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ cmd_swap_pane_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
if (src_wp == dst_wp)
|
if (src_wp == dst_wp)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if ((src_wp->flags & PANE_FLOATING) &&
|
||||||
|
(dst_wp->flags & PANE_FLOATING)) {
|
||||||
|
cmdq_error(item, "cannot swap floating panes");
|
||||||
|
return (CMD_RETURN_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
server_client_remove_pane(src_wp);
|
server_client_remove_pane(src_wp);
|
||||||
server_client_remove_pane(dst_wp);
|
server_client_remove_pane(dst_wp);
|
||||||
|
|
||||||
@@ -98,6 +104,10 @@ cmd_swap_pane_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
dst_wp->layout_cell = src_lc;
|
dst_wp->layout_cell = src_lc;
|
||||||
dst_lc->wp = src_wp;
|
dst_lc->wp = src_wp;
|
||||||
src_wp->layout_cell = dst_lc;
|
src_wp->layout_cell = dst_lc;
|
||||||
|
if ((src_wp->flags ^ dst_wp->flags) & PANE_FLOATING) {
|
||||||
|
src_wp->flags ^= PANE_FLOATING;
|
||||||
|
dst_wp->flags ^= PANE_FLOATING;
|
||||||
|
}
|
||||||
|
|
||||||
src_wp->window = dst_w;
|
src_wp->window = dst_w;
|
||||||
options_set_parent(src_wp->options, dst_w->options);
|
options_set_parent(src_wp->options, dst_w->options);
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ layout_assign(struct window_pane **wp, struct layout_cell *lc, int flags)
|
|||||||
case LAYOUT_TOPBOTTOM:
|
case LAYOUT_TOPBOTTOM:
|
||||||
case LAYOUT_FLOATING:
|
case LAYOUT_FLOATING:
|
||||||
TAILQ_FOREACH(lcchild, &lc->cells, entry)
|
TAILQ_FOREACH(lcchild, &lc->cells, entry)
|
||||||
layout_assign(wp, lcchild, 1);
|
layout_assign(wp, lcchild, PANE_FLOATING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ screen_redraw_type_of_cell(struct screen_redraw_ctx *ctx,
|
|||||||
struct client *c = ctx->c;
|
struct client *c = ctx->c;
|
||||||
struct window *w = c->session->curw->window;
|
struct window *w = c->session->curw->window;
|
||||||
int pane_status = ctx->pane_status, borders = 0;
|
int pane_status = ctx->pane_status, borders = 0;
|
||||||
int sx = w->sx, sy = w->sy;;
|
int sx = w->sx, sy = w->sy;
|
||||||
|
|
||||||
/* Is this outside the window? */
|
/* Is this outside the window? */
|
||||||
if (pane_status == PANE_STATUS_BOTTOM)
|
if (pane_status == PANE_STATUS_BOTTOM)
|
||||||
@@ -480,7 +480,6 @@ screen_redraw_check_cell(struct screen_redraw_ctx *ctx, int px, int py,
|
|||||||
if (~wp->flags & PANE_FLOATING)
|
if (~wp->flags & PANE_FLOATING)
|
||||||
tiled_only = 1;
|
tiled_only = 1;
|
||||||
do { /* Loop until back to wp == start.*/
|
do { /* Loop until back to wp == start.*/
|
||||||
|
|
||||||
if (!window_pane_visible(wp) ||
|
if (!window_pane_visible(wp) ||
|
||||||
(tiled_only && (wp->flags & PANE_FLOATING)))
|
(tiled_only && (wp->flags & PANE_FLOATING)))
|
||||||
goto next;
|
goto next;
|
||||||
|
|||||||
Reference in New Issue
Block a user