diff --git a/kitty/render_cache.py b/kitty/render_cache.py index f4547e458..8c3c1f9f8 100644 --- a/kitty/render_cache.py +++ b/kitty/render_cache.py @@ -84,9 +84,9 @@ class ImageRenderCache: import struct from hashlib import sha256 src_info = os.stat(src_path) + output_name = sha256(struct.pack('@qqqq', src_info.st_dev, src_info.st_ino, src_info.st_size, src_info.st_mtime_ns)).hexdigest() with self: - output_name = sha256(struct.pack('@qqqq', src_info.st_dev, src_info.st_ino, src_info.st_size, src_info.st_mtime_ns)).hexdigest() output_path = os.path.join(self.cache_dir, output_name) with suppress(OSError): self.touch(output_path) diff --git a/kitty/state.c b/kitty/state.c index e93dd0e22..be666bb49 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -189,7 +189,7 @@ send_bgimage_to_gpu(BackgroundImageLayout layout, BackgroundImage *bgimage) { r = REPEAT_DEFAULT; break; } bgimage->texture_id = 0; - size_t delta = bgimage->mmap_size ? 8 : 0; + size_t delta = bgimage->mmap_size ? bgimage->mmap_size - bgimage->width * bgimage->height * 4 : 0; send_image_to_gpu(&bgimage->texture_id, bgimage->bitmap + delta, bgimage->width, bgimage->height, false, true, OPT(background_image_linear), r); free_bgimage_bitmap(bgimage); diff --git a/kitty/window_logo.c b/kitty/window_logo.c index 496dfb242..940ad95f7 100644 --- a/kitty/window_logo.c +++ b/kitty/window_logo.c @@ -54,7 +54,7 @@ free_window_logo(WindowLogoItem **itemref) { static void send_logo_to_gpu(WindowLogo *s) { - size_t off = s->mmap_size ? 8 : 0; + size_t off = s->mmap_size ? s->mmap_size - 4 * s->width * s->height : 0; send_image_to_gpu(&s->texture_id, s->bitmap + off, s->width, s->height, false, true, true, REPEAT_CLAMP); free_window_logo_bitmap(s); }