direct mode: work with separate load+display kitty #1865

This commit is contained in:
nick black 2021-07-05 23:50:04 -04:00 committed by Nick Black
parent 56433a1a7f
commit 0b794bba64

View File

@ -403,6 +403,8 @@ ncdirect_align(struct ncdirect* n, ncalign_e align, int c){
return INT_MAX;
}
// FIXME need to run this through a memstream, or else we run into blocking
// issues with stdio (see ncflush())
static int
ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
const int toty = ncdirect_dim_y(n);
@ -425,6 +427,11 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
if(blocking_write(fileno(n->ttyfp), np->sprite->glyph, np->sprite->glyphlen) < 0){
return -1;
}
if(n->tcache.pixel_commit){
if(n->tcache.pixel_commit(n->ttyfp, np->sprite)){
return -1;
}
}
return 0;
}
//fprintf(stderr, "rasterizing %dx%d+%d\n", dimy, dimx, xoff);