Function: image--window-state-change

image--window-state-change is a byte-compiled function defined in image-mode.el.gz.

Signature

(image--window-state-change WINDOW)

Source Code

;; Defined in /usr/src/emacs/lisp/image-mode.el.gz
(defun image--window-state-change (window)
  ;; Wait for a bit of idle-time before actually performing the change,
  ;; so as to batch together sequences of closely consecutive size changes.
  ;; `image-fit-to-window' just changes one value in a plist.  The actual
  ;; image resizing happens later during redisplay.  So if those
  ;; consecutive calls happen without any redisplay between them,
  ;; the costly operation of image resizing should happen only once.
  (when (numberp image-auto-resize-on-window-resize)
    (when image-auto-resize-timer
      (cancel-timer image-auto-resize-timer))
    (setq image-auto-resize-timer
          (run-with-idle-timer image-auto-resize-on-window-resize nil
                               #'image-fit-to-window window))))