diff --git a/kitty/graphics.c b/kitty/graphics.c index 3b1939625..bbbb2c233 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -814,6 +814,11 @@ handle_delete_command(GraphicsManager *self, const GraphicsCommand *g, Cursor *c // }}} +void +grman_resize(GraphicsManager *self, index_type UNUSED old_lines, index_type UNUSED lines, index_type UNUSED old_columns, index_type UNUSED columns) { + self->layers_dirty = true; +} + const char* grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_t *payload, Cursor *c, bool *is_dirty) { Image *image; diff --git a/kitty/graphics.h b/kitty/graphics.h index 8ffe10bb5..45a3d7fe4 100644 --- a/kitty/graphics.h +++ b/kitty/graphics.h @@ -88,3 +88,4 @@ void grman_clear(GraphicsManager*); const char* grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_t *payload, Cursor *c, bool *is_dirty); bool grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float screen_left, float screen_top, float dx, float dy, unsigned int num_cols, unsigned int num_rows); void grman_scroll_images(GraphicsManager *self, const ScrollData*); +void grman_resize(GraphicsManager*, index_type, index_type, index_type, index_type); diff --git a/kitty/screen.c b/kitty/screen.c index 0cf11dc10..8d661ea44 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -149,14 +149,16 @@ screen_resize(Screen *self, unsigned int lines, unsigned int columns) { if (n == NULL) return false; Py_CLEAR(self->main_linebuf); self->main_linebuf = n; if (is_main) num_content_lines = num_content_lines_after; + grman_resize(self->main_grman, self->lines, lines, self->columns, columns); + + // Resize alt linebuf n = realloc_lb(self->alt_linebuf, lines, columns, &num_content_lines_before, &num_content_lines_after, NULL); if (n == NULL) return false; Py_CLEAR(self->alt_linebuf); self->alt_linebuf = n; - - // Resize alt linebuf if (!is_main) num_content_lines = num_content_lines_after; - self->linebuf = is_main ? self->main_linebuf : self->alt_linebuf; + grman_resize(self->alt_grman, self->lines, lines, self->columns, columns); + self->linebuf = is_main ? self->main_linebuf : self->alt_linebuf; self->lines = lines; self->columns = columns; self->margin_top = 0; self->margin_bottom = self->lines - 1;