From 59bf2c8c92f9a534e993fb14fbcf553040165001 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Nov 2026 08:47:38 +0530 Subject: [PATCH] Fix animated images stopping when switching tabs Animations are only scanned in the windows of the active tab, so if the previously active tab had no animations, scanning stopped and was never restarted when switching back. Request a rescan when the active tab changes. Fixes #10894 --- docs/changelog.rst | 2 ++ kitty/state.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index ef039d9dc..12e418ada 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -127,6 +127,8 @@ Detailed list of changes - Fix a crash when calling :code:`Screen.hyperlink_at()` with coordinates outside the screen, such as from a watcher (:iss:`10890`) +- Fix animated images stopping when switching to a tab without animations and then back (:iss:`10894`) + 0.51.0 [2026-11-18] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/state.c b/kitty/state.c index b7bca2916..158613c57 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -666,6 +666,10 @@ set_active_tab(id_type os_window_id, unsigned int idx) { WITH_OS_WINDOW(os_window_id) os_window->active_tab = idx; os_window->needs_render = true; + // Animations are only scanned in windows of the active tab, so if the + // previously active tab had none, scanning stopped and must be restarted + // for the newly active tab, see https://github.com/kovidgoyal/kitty/issues/10894 + global_state.check_for_active_animated_images = true; update_os_window_visibility_reports(os_window); END_WITH_OS_WINDOW }