From 0b794bba644b29ec3665b79a0eb1385ad78b00c9 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 5 Jul 2021 23:50:04 -0400 Subject: [PATCH] direct mode: work with separate load+display kitty #1865 --- src/lib/direct.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/direct.c b/src/lib/direct.c index 4b796ede3..38a47fc88 100644 --- a/src/lib/direct.c +++ b/src/lib/direct.c @@ -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);