[kitty] pass C=1 for move command

pull/1897/head
nick black 3 years ago
parent 1493045490
commit 3c2fe36fc9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -70,8 +70,7 @@ endif()
# global compiler flags
add_compile_definitions(_FORTIFY_SOURCE=2)
add_compile_options(-Wall -Wextra -W -Wshadow -Wformat -Wno-nonnull-compare
-Wformat-security -fexceptions -fstrict-aliasing
-Wno-string-plus-int)
-Wformat-security -fexceptions -fstrict-aliasing)
message(STATUS "Requested multimedia engine: ${USE_MULTIMEDIA}")
message(STATUS "Requested build mode: ${CMAKE_BUILD_TYPE}")

@ -193,7 +193,7 @@ unicodedumper(struct ncplane* n, tinfo* ti, const char* indent){
return 0;
}
static int
/*static int
display_logo(const tinfo* ti, struct ncplane* n, const char* path){
struct ncvisual* ncv = ncvisual_from_file(path);
if(ncv == NULL){
@ -220,7 +220,7 @@ display_logo(const tinfo* ti, struct ncplane* n, const char* path){
}
ncvisual_destroy(ncv);
return 0;
}
}*/
static void
tinfo_debug_bitmaps(struct ncplane* n, const tinfo* ti, const char* indent){

@ -769,7 +769,7 @@ void sprixel_free(sprixel* s);
void sprixel_hide(sprixel* s);
int kitty_draw(const ncpile *p, sprixel* s, FILE* out);
int kitty_move(const ncpile *p, sprixel* s, FILE* out);
int kitty_move(sprixel* s, FILE* out, unsigned noscroll);
int sixel_draw(const ncpile *p, sprixel* s, FILE* out);
// dimy and dimx are cell geometry, not pixel.
sprixel* sprixel_alloc(ncplane* n, int dimy, int dimx);
@ -832,7 +832,11 @@ static inline int
sprite_redraw(const notcurses* n, const ncpile* p, sprixel* s, FILE* out){
//sprixel_debug(s, stderr);
if(s->invalidated == SPRIXEL_MOVED && n->tcache.pixel_move){
return n->tcache.pixel_move(p, s, out);
// if we are kitty prior to 0.20.0, C=1 isn't available to us, and we must
// not emit it. we use sixel_maxy_pristine as a side channel to encode
// this version information.
bool noscroll = !n->tcache.sixel_maxy_pristine;
return n->tcache.pixel_move(s, out, noscroll);
}else{
return n->tcache.pixel_draw(p, s, out);
}

@ -627,10 +627,10 @@ int kitty_draw(const ncpile* p, sprixel* s, FILE* out){
}
// returns -1 on failure, 0 on success (move bytes do not count for sprixel stats)
int kitty_move(const ncpile* p, sprixel* s, FILE* out){
(void)p;
int kitty_move(sprixel* s, FILE* out, unsigned noscroll){
int ret = 0;
if(fprintf(out, "\e_Ga=p,i=%d,p=1,q=2\e\\", s->id) < 0){
if(fprintf(out, "\e_Ga=p,i=%d,p=1,q=2%s\e\\", s->id,
noscroll ? ",C=1" : "") < 0){
ret = -1;
}
s->invalidated = SPRIXEL_QUIESCENT;

@ -132,7 +132,7 @@ typedef struct tinfo {
int (*pixel_init)(const struct tinfo*, int fd); // called when support is detected
int (*pixel_draw)(const struct ncpile* p, struct sprixel* s, FILE* out);
// execute move (erase old graphic, place at new location) if non-NULL
int (*pixel_move)(const struct ncpile* p, struct sprixel* s, FILE* out);
int (*pixel_move)(struct sprixel* s, FILE* out, unsigned noscroll);
int (*pixel_scrub)(const struct ncpile* p, struct sprixel* s);
int (*pixel_shutdown)(FILE* fp); // called during context shutdown
int (*pixel_clear_all)(FILE* fp); // called during context startup

Loading…
Cancel
Save