diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-14 11:18:19 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-05-14 11:18:19 +0100 |
commit | 0bdbf47ef946b3535cc32b45ea8d971de5baddb5 (patch) | |
tree | a44b650fc7eb232083f25e070f243899ed9cbedc /screen-redraw.c | |
parent | 12eceaf2b3ef2b028a55d8ad11951be700be0446 (diff) | |
download | rtmux-0bdbf47ef946b3535cc32b45ea8d971de5baddb5.tar.gz rtmux-0bdbf47ef946b3535cc32b45ea8d971de5baddb5.tar.bz2 rtmux-0bdbf47ef946b3535cc32b45ea8d971de5baddb5.zip |
Add a client flag 'active-pane' which stores the active pane in the client and
allows it to be changed independently from the real active pane stored in the
window. This is can be used with session groups which allow an independent
current window (although it would be nice to have a flag for this too and
remove session groups). The client active pane is only really useful
interactively, many things (hooks, window-style, zooming) still use the window
active pane.
Diffstat (limited to 'screen-redraw.c')
-rw-r--r-- | screen-redraw.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/screen-redraw.c b/screen-redraw.c index fc2817ce..564fd9c9 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -242,7 +242,7 @@ screen_redraw_check_cell(struct client *c, u_int px, u_int py, int pane_status, struct window_pane **wpp) { struct window *w = c->session->curw->window; - struct window_pane *wp; + struct window_pane *wp, *active; int border; u_int right, line; @@ -254,7 +254,7 @@ screen_redraw_check_cell(struct client *c, u_int px, u_int py, int pane_status, return (screen_redraw_type_of_cell(c, px, py, pane_status)); if (pane_status != PANE_STATUS_OFF) { - wp = w->active; + active = wp = server_client_get_pane(c); do { if (!window_pane_visible(wp)) goto next1; @@ -272,10 +272,10 @@ screen_redraw_check_cell(struct client *c, u_int px, u_int py, int pane_status, wp = TAILQ_NEXT(wp, entry); if (wp == NULL) wp = TAILQ_FIRST(&w->panes); - } while (wp != w->active); + } while (wp != active); } - wp = w->active; + active = wp = server_client_get_pane(c); do { if (!window_pane_visible(wp)) goto next2; @@ -296,7 +296,7 @@ screen_redraw_check_cell(struct client *c, u_int px, u_int py, int pane_status, wp = TAILQ_NEXT(wp, entry); if (wp == NULL) wp = TAILQ_FIRST(&w->panes); - } while (wp != w->active); + } while (wp != active); return (CELL_OUTSIDE); } @@ -330,7 +330,7 @@ screen_redraw_make_pane_status(struct client *c, struct window *w, ft = format_create(c, NULL, FORMAT_PANE|wp->id, FORMAT_STATUS); format_defaults(ft, c, c->session, c->session->curw, wp); - if (wp == w->active) + if (wp == server_client_get_pane(c)) style_apply(&gc, w->options, "pane-active-border-style", ft); else style_apply(&gc, w->options, "pane-border-style", ft); @@ -558,6 +558,7 @@ screen_redraw_draw_borders_style(struct screen_redraw_ctx *ctx, u_int x, struct client *c = ctx->c; struct session *s = c->session; struct window *w = s->curw->window; + struct window_pane *active = server_client_get_pane(c); struct options *oo = w->options; struct grid_cell *gc; struct format_tree *ft; @@ -569,7 +570,7 @@ screen_redraw_draw_borders_style(struct screen_redraw_ctx *ctx, u_int x, ft = format_create_defaults(NULL, c, s, s->curw, wp); gc = &wp->border_gc; - if (screen_redraw_check_is(x, y, ctx->pane_status, w->active)) { + if (screen_redraw_check_is(x, y, ctx->pane_status, active)) { style_apply(gc, oo, "pane-active-border-style", ft); gc->attr |= GRID_ATTR_CHARSET; } else { |