diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-04 19:03:52 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-04 19:03:52 +0000 |
commit | 1f9a8e70d90265de8a3e1b0a981d3ef5b1352e52 (patch) | |
tree | 018210dd36bc8ec617921a75f2928aff488327e5 /server-fn.c | |
parent | 418fb3938d2e8da39a4776d01ff3f65aca2c686f (diff) |
Incomplete resize support.
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/server-fn.c b/server-fn.c index 5237dada..97e0456d 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.17 2007-10-04 10:39:07 nicm Exp $ */ +/* $Id: server-fn.c,v 1.18 2007-10-04 19:03:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -128,7 +128,7 @@ server_redraw_status(struct client *c) struct hdr hdr; size_t size; - if (status_lines == 0) + if (status_lines == 0 || c->sy <= status_lines) return; buffer_ensure(c->out, sizeof hdr); @@ -144,11 +144,35 @@ server_redraw_status(struct client *c) } void -server_redraw_client(struct client *c) +server_clear_client(struct client *c) { + struct screen *s = &c->session->window->screen; struct hdr hdr; size_t size; + u_int i; + + buffer_ensure(c->out, sizeof hdr); + buffer_add(c->out, sizeof hdr); + size = BUFFER_USED(c->out); + + input_store_zero(c->out, CODE_CURSOROFF); + for (i = 0; i < s->sy; i++) { + input_store_two(c->out, CODE_CURSORMOVE, i + 1, 1); + input_store_zero(c->out, CODE_CLEARLINE); + } + + size = BUFFER_USED(c->out) - size; + hdr.type = MSG_DATA; + hdr.size = size; + memcpy(BUFFER_IN(c->out) - size - sizeof hdr, &hdr, sizeof hdr); +} + +void +server_redraw_client(struct client *c) +{ struct screen *s = &c->session->window->screen; + struct hdr hdr; + size_t size; buffer_ensure(c->out, sizeof hdr); buffer_add(c->out, sizeof hdr); @@ -182,6 +206,19 @@ server_redraw_session(struct session *s) } void +server_clear_window(struct window *w) +{ + struct client *c; + u_int i; + + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c != NULL && c->session != NULL && c->session->window == w) + server_clear_client(c); + } +} + +void server_redraw_window(struct window *w) { struct client *c; |