Function: frame-monitor-attributes
frame-monitor-attributes is a byte-compiled function defined in
frame.el.gz.
Signature
(frame-monitor-attributes &optional FRAME)
Documentation
Return the attributes of the physical monitor dominating FRAME.
If FRAME is omitted or nil, describe the currently selected frame.
A frame is dominated by a physical monitor when either the largest area of the frame resides in the monitor, or the monitor is the closest to the frame if the frame does not intersect any physical monitors.
See display-monitor-attributes-list for the list of attribute
keys and their meanings.
Probably introduced at or before Emacs version 24.4.
Source Code
;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun frame-monitor-attributes (&optional frame)
"Return the attributes of the physical monitor dominating FRAME.
If FRAME is omitted or nil, describe the currently selected frame.
A frame is dominated by a physical monitor when either the
largest area of the frame resides in the monitor, or the monitor
is the closest to the frame if the frame does not intersect any
physical monitors.
See `display-monitor-attributes-list' for the list of attribute
keys and their meanings."
(or frame (setq frame (selected-frame)))
(cl-loop for attributes in (display-monitor-attributes-list frame)
for frames = (cdr (assq 'frames attributes))
if (memq frame frames) return attributes
;; On broken frames monitor attributes,
;; fall back to the last monitor.
finally return attributes))