diff --git a/CMakeLists.txt b/CMakeLists.txt index ccda58536..f6ab62ffb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/src/info/main.c b/src/info/main.c index c6ac7919b..71bf36ebb 100644 --- a/src/info/main.c +++ b/src/info/main.c @@ -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){ diff --git a/src/lib/internal.h b/src/lib/internal.h index e52f84a0b..844a28f1a 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -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); } diff --git a/src/lib/kitty.c b/src/lib/kitty.c index c8ba0b549..f9b6a6e12 100644 --- a/src/lib/kitty.c +++ b/src/lib/kitty.c @@ -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; diff --git a/src/lib/termdesc.h b/src/lib/termdesc.h index f1a6fb476..286adbfaa 100644 --- a/src/lib/termdesc.h +++ b/src/lib/termdesc.h @@ -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