From e85473cee62b68b497b24ec160eb4b1c34513c0b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 27 Mar 2023 13:43:37 +0530 Subject: [PATCH] Linux Wayland: Fix animated images not being animated continuously Fixes #6126 --- docs/changelog.rst | 2 ++ kitty/child-monitor.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index c280443a6..70247733e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -84,6 +84,8 @@ Detailed list of changes - Allow stopping of URL detection at newlines via :opt:`url_excluded_characters` (:iss:`6122`) +- Linux Wayland: Fix animated images not being animated continuously (:iss:`6126`) + 0.27.1 [2023-02-07] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index cac54e63d..ea1a5eee0 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -818,7 +818,11 @@ render(monotonic_t now, bool input_read) { if (w->render_state == RENDER_FRAME_NOT_REQUESTED || no_render_frame_received_recently(w, now, ms_to_monotonic_t(250ll))) request_frame_render(w); // dont respect render frames soon after a resize on Wayland as they cause flicker because // we want to fill the newly resized buffer ASAP, not at compositors convenience - if (!global_state.is_wayland || (monotonic() - w->viewport_resized_at) > s_double_to_monotonic_t(1)) continue; + if (!global_state.is_wayland || (monotonic() - w->viewport_resized_at) > s_double_to_monotonic_t(1)) { + // since we didnt scan the window for animations, force a rescan on next wakeup/render frame + if (scan_for_animated_images) global_state.check_for_active_animated_images = true; + continue; + } } w->render_calls++; make_os_window_context_current(w);