diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-19 20:14:55 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-19 20:14:55 +0000 |
commit | 2afa8ebc021d82e0416c54ab47bbbfcb5d318a1d (patch) | |
tree | 8b19377fb2d197dc2099f0bfe6827eda4a86068d /status.c | |
parent | 94471aab827d152375514a8bf69ac2f751e3ca67 (diff) | |
download | rtmux-2afa8ebc021d82e0416c54ab47bbbfcb5d318a1d.tar.gz rtmux-2afa8ebc021d82e0416c54ab47bbbfcb5d318a1d.tar.bz2 rtmux-2afa8ebc021d82e0416c54ab47bbbfcb5d318a1d.zip |
Fix various silly problems with status line off.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.65 2009-01-19 19:01:11 nicm Exp $ */ +/* $Id: status.c,v 1.66 2009-01-19 20:14:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -53,6 +53,13 @@ status_redraw(struct client *c) left = right = NULL; + /* Resize the target screen. */ + if (screen_size_x(&c->status) != c->sx) { + screen_free(&c->status); + screen_init(&c->status, c->sx, 1, 0); + } + + /* No status line? */ if (c->sy == 0 || !options_get_number(&s->options, "status")) goto off; larrow = rarrow = 0; @@ -67,6 +74,7 @@ status_redraw(struct client *c) if (yy == 0) goto blank; + /* Work out the left and right strings. */ left = status_replace(s, options_get_string( &s->options, "status-left"), c->status_timer.tv_sec); llen = options_get_number(&s->options, "status-left-length"); @@ -147,12 +155,6 @@ status_redraw(struct client *c) width = xx; draw: - /* Resize the target screen. */ - if (screen_size_x(&c->status) != c->sx) { - screen_free(&c->status); - screen_init(&c->status, c->sx, 1, 0); - } - /* Bail here if anything is too small too. XXX. */ if (width == 0 || xx == 0) goto blank; @@ -259,20 +261,20 @@ off: * Draw the real window last line. Necessary to wipe over message if * status is off. Not sure this is the right place for this. */ + memcpy(&gc, &grid_default_cell, sizeof gc); screen_write_start(&ctx, NULL, &c->status); sy = 0; TAILQ_FOREACH(wp, &s->curw->window->panes, entry) { - sy += wp->sy; + sy += wp->sy + 1; sc = wp->screen; } - sy++; screen_write_cursormove(&ctx, 0, 0); - if (sy < c->sy - 1) { + if (sy < c->sy) { /* If the screen is too small, use blank. */ - for (offset = 0; offset < c->sx; offset++) - screen_write_putc(&ctx, &gc, ' '); + for (offset = 0; offset < c->sx; offset++) + screen_write_putc(&ctx, &gc, ' '); } else { screen_write_copy(&ctx, sc, 0, sc->grid->hsize + screen_size_y(sc) - 1, c->sx, 1); |