From acc43ce9dce91fbae91b45671704b4560db44216 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 3 Oct 2017 20:34:48 +0530 Subject: [PATCH] Handle T action with chunked transfer correctly --- kitty/graphics.c | 3 ++- kitty/graphics.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kitty/graphics.c b/kitty/graphics.c index 134b6f50a..9c8b7e764 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -320,6 +320,7 @@ handle_add_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_ if (tt == 'd' && self->loading_image) init_img = false; if (init_img) { self->loading_image = 0; + self->last_init_img_action = g->action; if (g->data_width > 10000 || g->data_height > 10000) ABRT(EINVAL, "Image too large"); remove_images(self, add_trim_predicate); img = find_or_create_image(self, g->id, &existing); @@ -602,7 +603,7 @@ grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint case 'T': image = handle_add_command(self, g, payload, is_dirty); ret = create_add_response(self, g, image != NULL); - if (g->action == 'T') handle_put_command(self, g, c, is_dirty, image); + if (self->last_init_img_action == 'T') handle_put_command(self, g, c, is_dirty, image); break; case 'p': if (!g->id) { diff --git a/kitty/graphics.h b/kitty/graphics.h index b010fa132..7607b3595 100644 --- a/kitty/graphics.h +++ b/kitty/graphics.h @@ -64,6 +64,7 @@ typedef struct { index_type lines, columns; size_t image_count, images_capacity, loading_image; + char last_init_img_action; Image *images; size_t count, capacity, rp_capacity; ImageRenderData *render_data;