mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Clear blank area properly on redraw, and add a marker line below it.
This commit is contained in:
parent
0bfd7a5023
commit
62d7ad2690
11
resize.c
11
resize.c
@ -1,4 +1,4 @@
|
||||
/* $Id: resize.c,v 1.13 2008-06-07 07:13:08 nicm Exp $ */
|
||||
/* $Id: resize.c,v 1.14 2008-06-14 12:05:06 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -122,13 +122,6 @@ recalculate_sizes(void)
|
||||
screen_size_x(&w->base), screen_size_y(&w->base));
|
||||
|
||||
window_resize(w, ssx, ssy);
|
||||
|
||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||
c = ARRAY_ITEM(&clients, i);
|
||||
if (c == NULL || c->session == NULL)
|
||||
continue;
|
||||
if (c->session->curw->window == w)
|
||||
c->flags |= (CLIENT_CLEAR|CLIENT_REDRAW);
|
||||
}
|
||||
server_redraw_window(w);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: screen-redraw.c,v 1.4 2008-01-03 21:32:11 nicm Exp $ */
|
||||
/* $Id: screen-redraw.c,v 1.5 2008-06-14 12:05:06 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -149,18 +149,6 @@ screen_redraw_write_string(struct screen_redraw_ctx *ctx, const char *fmt, ...)
|
||||
xfree(msg);
|
||||
}
|
||||
|
||||
/* Clear screen. */
|
||||
void
|
||||
screen_redraw_clear_screen(struct screen_redraw_ctx *ctx)
|
||||
{
|
||||
u_int i;
|
||||
|
||||
for (i = 0; i < screen_size_y(ctx->s); i++) {
|
||||
screen_redraw_move_cursor(ctx, 0, i);
|
||||
ctx->write(ctx->data, TTY_CLEARLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Redraw single cell. */
|
||||
void
|
||||
screen_redraw_cell(struct screen_redraw_ctx *ctx, u_int px, u_int py)
|
||||
|
9
screen.c
9
screen.c
@ -1,4 +1,4 @@
|
||||
/* $Id: screen.c,v 1.60 2008-06-03 21:42:37 nicm Exp $ */
|
||||
/* $Id: screen.c,v 1.61 2008-06-14 12:05:06 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -297,13 +297,8 @@ void
|
||||
screen_set_cell(struct screen *s,
|
||||
u_int cx, u_int cy, u_char data, u_char attr, u_char colr)
|
||||
{
|
||||
if (cx >= s->grid_size[cy]) {
|
||||
if (data == SCREEN_DEFDATA &&
|
||||
attr == SCREEN_DEFATTR &&
|
||||
colr == SCREEN_DEFCOLR)
|
||||
return;
|
||||
if (cx >= s->grid_size[cy])
|
||||
screen_expand_line(s, cy, cx + 1);
|
||||
}
|
||||
|
||||
s->grid_data[cy][cx] = data;
|
||||
s->grid_attr[cy][cx] = attr;
|
||||
|
34
server.c
34
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);
|
||||
|
3
tmux.h
3
tmux.h
@ -1,4 +1,4 @@
|
||||
/* $Id: tmux.h,v 1.139 2008-06-07 07:27:28 nicm Exp $ */
|
||||
/* $Id: tmux.h,v 1.140 2008-06-14 12:05:06 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -1001,7 +1001,6 @@ void screen_redraw_move_cursor(struct screen_redraw_ctx *, u_int, u_int);
|
||||
void screen_redraw_set_attributes(struct screen_redraw_ctx *, u_int, u_int);
|
||||
void printflike2 screen_redraw_write_string(
|
||||
struct screen_redraw_ctx *, const char *, ...);
|
||||
void screen_redraw_clear_screen(struct screen_redraw_ctx *);
|
||||
void screen_redraw_cell(struct screen_redraw_ctx *, u_int, u_int);
|
||||
void screen_redraw_area(
|
||||
struct screen_redraw_ctx *, u_int, u_int, u_int, u_int);
|
||||
|
Loading…
Reference in New Issue
Block a user