Skip to content

Commit 7f48a92

Browse files
committed
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
1 parent 4a740cc commit 7f48a92

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
1616

1717
- Adjust cell height automatically for buggy fonts that draw brackets outside the bounding box
1818

19+
- Fix image leaving behind a black rectangle when switch away and back to
20+
alternate screen (:iss:`2901`)
21+
1922

2023
0.18.2 [2020-07-28]
2124
--------------------

kitty/graphics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float scree
646646

647647
static inline void
648648
filter_refs(GraphicsManager *self, const void* data, bool free_images, bool (*filter_func)(ImageRef*, Image*, const void*, CellPixelSize), CellPixelSize cell) {
649-
self->layers_dirty = self->image_count > 0;
649+
if (self->image_count) self->layers_dirty = true;
650650
for (size_t i = self->image_count; i-- > 0;) {
651651
Image *img = self->images + i;
652652
for (size_t j = img->refcnt; j-- > 0;) {

0 commit comments

Comments
 (0)