summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/screen-redraw.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-08-19 20:13:08 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-08-19 20:13:08 +0000
commitb2ded5fd8b53da83c4b7b2f103f368f4b7f10f3a (patch)
tree59644d9ac3d263d35880f3bee6a6ee50594e4606 /usr.bin/tmux/screen-redraw.c
parent435259bf3cd64561bba759af91f8350da80171c8 (diff)
Add a flag to force redrawing of the status line even if the content
hasn't changed, needed for resizing.
Diffstat (limited to 'usr.bin/tmux/screen-redraw.c')
-rw-r--r--usr.bin/tmux/screen-redraw.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c
index 4cb21452db3..f0cf2a8cfaf 100644
--- a/usr.bin/tmux/screen-redraw.c
+++ b/usr.bin/tmux/screen-redraw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-redraw.c,v 1.53 2018/08/19 16:45:03 nicm Exp $ */
+/* $OpenBSD: screen-redraw.c,v 1.54 2018/08/19 20:13:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -344,8 +344,8 @@ screen_redraw_draw_pane_status(struct screen_redraw_ctx *ctx)
}
/* Update status line and change flags if unchanged. */
-static void
-screen_redraw_update(struct client *c)
+static int
+screen_redraw_update(struct client *c, int flags)
{
struct window *w = c->session->curw->window;
struct window_pane *wp;
@@ -358,8 +358,8 @@ screen_redraw_update(struct client *c)
redraw = status_prompt_redraw(c);
else
redraw = status_redraw(c);
- if (!redraw)
- c->flags &= ~CLIENT_REDRAWSTATUS;
+ if (!redraw && (~flags & CLIENT_REDRAWSTATUSALWAYS))
+ flags &= ~CLIENT_REDRAWSTATUS;
if (options_get_number(wo, "pane-border-status") != CELL_STATUS_OFF) {
redraw = 0;
@@ -368,8 +368,9 @@ screen_redraw_update(struct client *c)
redraw = 1;
}
if (redraw)
- c->flags |= CLIENT_REDRAWBORDERS;
+ flags |= CLIENT_REDRAWBORDERS;
}
+ return (flags);
}
/* Set up redraw context. */
@@ -398,21 +399,23 @@ void
screen_redraw_screen(struct client *c)
{
struct screen_redraw_ctx ctx;
+ int flags;
if (c->flags & CLIENT_SUSPENDED)
return;
- screen_redraw_update(c);
+ flags = screen_redraw_update(c, c->flags);
screen_redraw_set_context(c, &ctx);
- if (c->flags & (CLIENT_REDRAWWINDOW|CLIENT_REDRAWBORDERS)) {
+ if (flags & (CLIENT_REDRAWWINDOW|CLIENT_REDRAWBORDERS)) {
if (ctx.pane_status != CELL_STATUS_OFF)
screen_redraw_draw_pane_status(&ctx);
screen_redraw_draw_borders(&ctx);
}
- if (c->flags & CLIENT_REDRAWWINDOW)
+ if (flags & CLIENT_REDRAWWINDOW)
screen_redraw_draw_panes(&ctx);
- if (ctx.lines != 0 && (c->flags & CLIENT_REDRAWSTATUS))
+ if (ctx.lines != 0 &&
+ (flags & (CLIENT_REDRAWSTATUS|CLIENT_REDRAWSTATUSALWAYS)))
screen_redraw_draw_status(&ctx);
tty_reset(&c->tty);
}