sixel: CSI setters also write a reply to the client

This commit is contained in:
Daniel Eklöf 2020-02-24 18:42:04 +01:00
parent 77fcb43ea5
commit 0c247de4ae
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

14
sixel.c
View file

@ -481,16 +481,19 @@ sixel_colors_report_current(struct terminal *term)
void void
sixel_colors_reset(struct terminal *term) sixel_colors_reset(struct terminal *term)
{ {
term->sixel.palette_size = SIXEL_MAX_COLORS;
LOG_DBG("sixel palette size reset to %u", SIXEL_MAX_COLORS); LOG_DBG("sixel palette size reset to %u", SIXEL_MAX_COLORS);
term->sixel.palette_size = SIXEL_MAX_COLORS;
sixel_colors_report_current(term);
} }
void void
sixel_colors_set(struct terminal *term, unsigned count) sixel_colors_set(struct terminal *term, unsigned count)
{ {
unsigned new_palette_size = min(max(2, count), SIXEL_MAX_COLORS); unsigned new_palette_size = min(max(2, count), SIXEL_MAX_COLORS);
term->sixel.palette_size = new_palette_size;
LOG_DBG("sixel palette size set to %u", new_palette_size); LOG_DBG("sixel palette size set to %u", new_palette_size);
term->sixel.palette_size = new_palette_size;
sixel_colors_report_current(term);
} }
void void
@ -517,18 +520,19 @@ sixel_geometry_report_current(struct terminal *term)
void void
sixel_geometry_reset(struct terminal *term) sixel_geometry_reset(struct terminal *term)
{ {
LOG_DBG("sixel geometry reset to %ux%u", max_width(term), max_height(term));
term->sixel.max_width = 0; term->sixel.max_width = 0;
term->sixel.max_height = 0; term->sixel.max_height = 0;
LOG_DBG("sixel geometry reset to %ux%u", max_width(term), max_height(term)); sixel_geometry_report_current(term);
} }
void void
sixel_geometry_set(struct terminal *term, unsigned width, unsigned height) sixel_geometry_set(struct terminal *term, unsigned width, unsigned height)
{ {
LOG_DBG("sixel geometry set to %ux%u", width, height);
term->sixel.max_width = width; term->sixel.max_width = width;
term->sixel.max_height = height; term->sixel.max_height = height;
LOG_DBG("sixel geometry set to %ux%u", sixel_geometry_report_current(term);
term->sixel.max_width, term->sixel.max_height);
} }
void void