summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-14 12:05:06 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-14 12:05:06 +0000
commit62d7ad2690c0f72f06195351aa50e3fe037f456a (patch)
tree1d37c6afd94b2b2941b9ef3694c349cef8d96c05 /server.c
parent0bfd7a502309d329bcd0a41353b07ca6c5c5cafa (diff)
Clear blank area properly on redraw, and add a marker line below it.
Diffstat (limited to 'server.c')
-rw-r--r--server.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/server.c b/server.c
index 04b04915..2f9a9b0c 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.61 2008-06-08 19:49:04 nicm Exp $ */
+/* $Id: server.c,v 1.62 2008-06-14 12:05:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -302,19 +302,35 @@ server_check_redraw(struct client *c)
{
struct screen_redraw_ctx ctx;
struct screen screen;
+ u_int xx, yy, sx, sy;
if (c == NULL || c->session == NULL)
return;
- if (c->flags & CLIENT_CLEAR) {
- screen_create(&screen, c->sx, c->sy - 1, 0);
- screen_redraw_start(&ctx, &screen, tty_write_client, c);
- screen_redraw_clear_screen(&ctx);
- screen_redraw_stop(&ctx);
- screen_destroy(&screen);
- }
-
+ xx = c->sx;
+ yy = c->sy - options_get_number(&global_options, "status-lines");
if (c->flags & CLIENT_REDRAW) {
+ sx = screen_size_x(c->session->curw->window->screen);
+ sy = screen_size_y(c->session->curw->window->screen);
+ if (sy < yy) {
+ /*
+ * Fake up a blank(ish) screen and use it. NOTE: because
+ * this uses tty_write_client but doesn't write the
+ * client's screen, this can't use anything which
+ * relies on cursor position. This is icky and might
+ * break if we try to optimise redrawing later :-/.
+ */
+ screen_create(&screen, xx, yy, 0);
+ screen_fill_area(&screen, 0, 0, xx, yy, ' ', 0, 0x70);
+ screen_fill_area(&screen, 0, sy, sx, 1, '-', 0, 0x70);
+
+ screen_redraw_start(&ctx, &screen, tty_write_client, c);
+ screen_redraw_lines(&ctx, sy, yy - sy);
+ screen_redraw_stop(&ctx);
+
+ screen_destroy(&screen);
+ }
+
screen_redraw_start_client(&ctx, c);
screen_redraw_lines(&ctx, 0, screen_size_y(ctx.s));
screen_redraw_stop(&ctx);