version 1.107, 2017/02/08 15:41:41 |
version 1.108, 2017/02/08 15:49:29 |
|
|
screen_write_start(struct screen_write_ctx *ctx, struct window_pane *wp, |
screen_write_start(struct screen_write_ctx *ctx, struct window_pane *wp, |
struct screen *s) |
struct screen *s) |
{ |
{ |
u_int size; |
u_int size; |
char tmp[16]; |
char tmp[16]; |
const char *cp = tmp; |
|
|
|
ctx->wp = wp; |
ctx->wp = wp; |
if (wp != NULL && s == NULL) |
if (wp != NULL && s == NULL) |
|
|
|
|
ctx->cells = ctx->written = ctx->skipped = 0; |
ctx->cells = ctx->written = ctx->skipped = 0; |
|
|
if (wp == NULL) |
if (wp != NULL) |
cp = "no pane"; |
|
else |
|
snprintf(tmp, sizeof tmp, "pane %%%u", wp->id); |
snprintf(tmp, sizeof tmp, "pane %%%u", wp->id); |
log_debug("%s: size %ux%u, %s", __func__, screen_size_x(ctx->s), |
log_debug("%s: size %ux%u, %s", __func__, screen_size_x(ctx->s), |
screen_size_y(ctx->s), cp); |
screen_size_y(ctx->s), wp == NULL ? "no pane" : tmp); |
} |
} |
|
|
/* Finish writing. */ |
/* Finish writing. */ |
|
|
struct tty_ctx ttyctx; |
struct tty_ctx ttyctx; |
u_int sx = screen_size_x(s); |
u_int sx = screen_size_x(s); |
|
|
screen_write_initctx(ctx, &ttyctx); |
|
ttyctx.bg = bg; |
|
|
|
gl = &s->grid->linedata[s->grid->hsize + s->cy]; |
gl = &s->grid->linedata[s->grid->hsize + s->cy]; |
if (gl->cellsize == 0 && bg == 8) |
if (gl->cellsize == 0 && bg == 8) |
return; |
return; |
|
|
|
screen_write_initctx(ctx, &ttyctx); |
|
ttyctx.bg = bg; |
|
|
screen_dirty_clear(s, 0, s->cy, sx - 1, s->cy); |
screen_dirty_clear(s, 0, s->cy, sx - 1, s->cy); |
grid_view_clear(s->grid, 0, s->cy, sx, 1, bg); |
grid_view_clear(s->grid, 0, s->cy, sx, 1, bg); |
|
|
|
|
struct tty_ctx ttyctx; |
struct tty_ctx ttyctx; |
u_int sx = screen_size_x(s); |
u_int sx = screen_size_x(s); |
|
|
screen_write_initctx(ctx, &ttyctx); |
|
ttyctx.bg = bg; |
|
|
|
gl = &s->grid->linedata[s->grid->hsize + s->cy]; |
gl = &s->grid->linedata[s->grid->hsize + s->cy]; |
if (s->cx > sx - 1 || (s->cx >= gl->cellsize && bg == 8)) |
if (s->cx > sx - 1 || (s->cx >= gl->cellsize && bg == 8)) |
return; |
return; |
|
|
|
screen_write_initctx(ctx, &ttyctx); |
|
ttyctx.bg = bg; |
|
|
screen_dirty_clear(s, s->cx, s->cy, sx - 1, s->cy); |
screen_dirty_clear(s, s->cx, s->cy, sx - 1, s->cy); |
grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1, bg); |
grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1, bg); |