From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47895: 28.0.50; Emacs should only animate images that are visible Date: Tue, 20 Apr 2021 16:51:02 +0300 Message-ID: <83r1j5qd2x.fsf@gnu.org> References: <87r1j6m920.fsf@gnus.org> <8335vmrux2.fsf@gnu.org> <87mttum230.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29503"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47895@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 20 15:52:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYqnR-0007W0-1D for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Apr 2021 15:52:09 +0200 Original-Received: from localhost ([::1]:33802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYqnQ-0006qU-4U for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Apr 2021 09:52:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYqnK-0006q2-4p for bug-gnu-emacs@gnu.org; Tue, 20 Apr 2021 09:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYqnJ-0007no-TR for bug-gnu-emacs@gnu.org; Tue, 20 Apr 2021 09:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYqnJ-0001lt-St for bug-gnu-emacs@gnu.org; Tue, 20 Apr 2021 09:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Apr 2021 13:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47895 X-GNU-PR-Package: emacs Original-Received: via spool by 47895-submit@debbugs.gnu.org id=B47895.16189266946774 (code B ref 47895); Tue, 20 Apr 2021 13:52:01 +0000 Original-Received: (at 47895) by debbugs.gnu.org; 20 Apr 2021 13:51:34 +0000 Original-Received: from localhost ([127.0.0.1]:53396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYqmr-0001lC-Q7 for submit@debbugs.gnu.org; Tue, 20 Apr 2021 09:51:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYqmq-0001ky-4Z for 47895@debbugs.gnu.org; Tue, 20 Apr 2021 09:51:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35285) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYqmj-0007R4-FF; Tue, 20 Apr 2021 09:51:26 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1948 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lYqmc-0004P4-0U; Tue, 20 Apr 2021 09:51:23 -0400 In-Reply-To: <87mttum230.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 19 Apr 2021 22:49:55 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:204535 Archived-At: > From: Lars Ingebrigtsen > Cc: 47895@debbugs.gnu.org > Date: Mon, 19 Apr 2021 22:49:55 +0200 > > (progn > (eww "https://lars.ingebrigtsen.no/wp-content/uploads/2018/03/candid.gif") > (bury-buffer)) The timer set up by image.el keeps "displaying" the animated GIF. In this simple case, we could use (get-buffer-window (plist-get (cdr image) :animate-buffer) 'visible) in image-animate-timeout to see if the buffer is displayed in any window. The harder questions are: . if the buffer is not displayed, what to do with the timer? continue running it? if so, how to interpret the LIMIT arg? . what if the window _is_ displayed, but the image is not visible? I think we'd need to record the image's buffer position in its plist, so that we could use pos-visible-in-window-p to find out whether the image is visible