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
This commit is contained in:
Kovid Goyal 2026-11-19 08:47:38 +05:30
parent 9a5c37a01d
commit 59bf2c8c92
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View file

@ -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]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -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
}