summaryrefslogtreecommitdiffstats
path: root/resize.c
diff options
context:
space:
mode:
authornicm <nicm>2017-10-16 19:30:53 +0000
committernicm <nicm>2017-10-16 19:30:53 +0000
commit2f6935a630507351233d6296cc6ec9a08d6a702a (patch)
treec58a22106fac6aa6999d02329498c5dc77f57989 /resize.c
parenta5fd5782f87362b8ee31cd5c6975728e112db9ff (diff)
Infrastructure for drawing status lines of more than one line in height,
still only one is allowed but this lets tmux draw bigger ones.
Diffstat (limited to 'resize.c')
-rw-r--r--resize.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/resize.c b/resize.c
index 0fd30ba0..8ed359b4 100644
--- a/resize.c
+++ b/resize.c
@@ -49,11 +49,11 @@ recalculate_sizes(void)
struct client *c;
struct window *w;
struct window_pane *wp;
- u_int ssx, ssy, has, limit;
- int flag, has_status, is_zoomed, forced;
+ u_int ssx, ssy, has, limit, lines;
+ int flag, is_zoomed, forced;
RB_FOREACH(s, sessions, &sessions) {
- has_status = options_get_number(s->options, "status");
+ lines = status_line_size(s);
s->attached = 0;
ssx = ssy = UINT_MAX;
@@ -66,10 +66,14 @@ recalculate_sizes(void)
if (c->session == s) {
if (c->tty.sx < ssx)
ssx = c->tty.sx;
- if (has_status &&
+ c->flags &= ~CLIENT_STATUSOFF;
+ if (lines != 0 && lines + PANE_MINIMUM > c->tty.sy)
+ c->flags |= CLIENT_STATUSOFF;
+ if ((~c->flags & CLIENT_STATUSOFF) &&
!(c->flags & CLIENT_CONTROL) &&
- c->tty.sy > 1 && c->tty.sy - 1 < ssy)
- ssy = c->tty.sy - 1;
+ c->tty.sy > lines &&
+ c->tty.sy - lines < ssy)
+ ssy = c->tty.sy - lines;
else if (c->tty.sy < ssy)
ssy = c->tty.sy;
s->attached++;
@@ -81,8 +85,8 @@ recalculate_sizes(void)
}
s->flags &= ~SESSION_UNATTACHED;
- if (has_status && ssy == 0)
- ssy = 1;
+ if (lines != 0 && ssy == 0)
+ ssy = lines;
if (s->sx == ssx && s->sy == ssy)
continue;