Function: frame-size-changed-p

frame-size-changed-p is a byte-compiled function defined in frame.el.gz.

Signature

(frame-size-changed-p &optional FRAME)

Documentation

Return non-nil when the size of FRAME has changed.

More precisely, return non-nil when the inner width or height of FRAME has changed since window-size-change-functions was run for FRAME.

View in manual

Probably introduced at or before Emacs version 26.1.

Source Code

;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun frame-size-changed-p (&optional frame)
  "Return non-nil when the size of FRAME has changed.
More precisely, return non-nil when the inner width or height of
FRAME has changed since `window-size-change-functions' was run
for FRAME."
  (let* ((frame (window-normalize-frame frame))
         (root (frame-root-window frame))
         (mini (minibuffer-window frame))
         (mini-old-height 0)
         (mini-height 0))
    ;; FRAME's minibuffer window counts iff it's on FRAME and FRAME is
    ;; not a minibuffer-only frame.
    (when (and (eq (window-frame mini) frame) (not (eq mini root)))
      (setq mini-old-height (window-old-pixel-height mini))
      (setq mini-height (window-pixel-height mini)))
    ;; Return non-nil when either the width of the root or the sum of
    ;; the heights of root and minibuffer window changed.
    (or (/= (window-old-pixel-width root) (window-pixel-width root))
        (/= (+ (window-old-pixel-height root) mini-old-height)
            (+ (window-pixel-height root) mini-height)))))