From 1fa1f3184a96cbf51aed68ed1e1c6eb799dcfc27 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 3 May 2021 11:51:53 +0200 Subject: [PATCH] Speed up animation of non-displayed buffers * lisp/image.el (image-show-frame): Don't force an update if the buffer with the animation isn't in a window (bug#47895). Also just update the window in question. --- lisp/image.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/image.el b/lisp/image.el index 5e84536b669..643f9ddf834 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -875,7 +875,9 @@ do not check N is within the range of frames present in the image." (setq n (min n (1- (car (plist-get (cdr image) :animate-multi-frame-data))))))) (plist-put (cdr image) :index n) - (force-window-update)) + (when-let ((window + (get-buffer-window (plist-get (cdr image) :animate-buffer) t))) + (force-window-update window))) (defun image-animate-get-speed (image) "Return the speed factor for animating IMAGE." -- 2.39.2