Fix image leaving behind a black rectangle when switching away and back to alternate screen

layer_dirty was being reset if remove_images was called more than once
without an intervening call to update_layers.

Fixes #2901
This commit is contained in:
Kovid Goyal
2020-08-06 19:05:58 +05:30
parent 4a740cc556
commit 7f48a927de
2 changed files with 4 additions and 1 deletions

View File

@@ -16,6 +16,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Adjust cell height automatically for buggy fonts that draw brackets outside the bounding box
- Fix image leaving behind a black rectangle when switch away and back to
alternate screen (:iss:`2901`)
0.18.2 [2020-07-28]
--------------------

View File

@@ -646,7 +646,7 @@ grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float scree
static inline void
filter_refs(GraphicsManager *self, const void* data, bool free_images, bool (*filter_func)(ImageRef*, Image*, const void*, CellPixelSize), CellPixelSize cell) {
self->layers_dirty = self->image_count > 0;
if (self->image_count) self->layers_dirty = true;
for (size_t i = self->image_count; i-- > 0;) {
Image *img = self->images + i;
for (size_t j = img->refcnt; j-- > 0;) {