aboutsummaryrefslogtreecommitdiff
path: root/window-client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-03-18 21:24:49 +0000
committerThomas Adam <thomas@xteddy.org>2019-03-18 21:24:49 +0000
commit962f255ee8f271920e8901824ae30fa7a0b40804 (patch)
tree32c8466be03d668fc42360e5f415ad689c5c95f9 /window-client.c
parent1d6fe43c7b2250f042d0113da8545d5ebb75c01e (diff)
parent979313832ce1d5f6cdc2c512e8524d6c517422e0 (diff)
downloadrtmux-962f255ee8f271920e8901824ae30fa7a0b40804.tar.gz
rtmux-962f255ee8f271920e8901824ae30fa7a0b40804.tar.bz2
rtmux-962f255ee8f271920e8901824ae30fa7a0b40804.zip
Merge branch 'obsd-master'
Diffstat (limited to 'window-client.c')
-rw-r--r--window-client.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/window-client.c b/window-client.c
index ec98984d..e0637a06 100644
--- a/window-client.c
+++ b/window-client.c
@@ -217,20 +217,36 @@ window_client_draw(__unused void *modedata, void *itemdata,
{
struct window_client_itemdata *item = itemdata;
struct client *c = item->c;
+ struct screen *s = ctx->s;
struct window_pane *wp;
- u_int cx = ctx->s->cx, cy = ctx->s->cy;
+ u_int cx = s->cx, cy = s->cy, lines, at;
if (c->session == NULL || (c->flags & (CLIENT_DEAD|CLIENT_DETACHING)))
return;
wp = c->session->curw->window->active;
- screen_write_preview(ctx, &wp->base, sx, sy - 3);
+ lines = status_line_size(c);
+ if (lines >= sy)
+ lines = 0;
+ if (status_at_line(c) == 0)
+ at = lines;
+ else
+ at = 0;
+
+ screen_write_cursormove(ctx, cx, cy + at, 0);
+ screen_write_preview(ctx, &wp->base, sx, sy - 2 - lines);
- screen_write_cursormove(ctx, cx, cy + sy - 2, 0);
+ if (at != 0)
+ screen_write_cursormove(ctx, cx, cy + 2, 0);
+ else
+ screen_write_cursormove(ctx, cx, cy + sy - 1 - lines, 0);
screen_write_hline(ctx, sx, 0, 0);
- screen_write_cursormove(ctx, cx, cy + sy - 1, 0);
- screen_write_fast_copy(ctx, &c->status.screen, 0, 0, sx, 1);
+ if (at != 0)
+ screen_write_cursormove(ctx, cx, cy, 0);
+ else
+ screen_write_cursormove(ctx, cx, cy + sy - lines, 0);
+ screen_write_fast_copy(ctx, &c->status.screen, 0, 0, sx, lines);
}
static struct screen *