Function: display-pixel-width
display-pixel-width is a byte-compiled function defined in
frame.el.gz.
Signature
(display-pixel-width &optional DISPLAY)
Documentation
Return the width of DISPLAY's screen in pixels.
DISPLAY can be a display name or a frame. If DISPLAY is omitted or nil, it defaults to the selected frame's display.
For character terminals, each character counts as a single pixel.
For graphical terminals, note that on "multi-monitor" setups this
refers to the pixel width for all physical monitors associated
with DISPLAY. To get information for each physical monitor, use
display-monitor-attributes-list.
Probably introduced at or before Emacs version 21.1.
Aliases
ediff-display-pixel-width (obsolete since 27.1)
Source Code
;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun display-pixel-width (&optional display)
"Return the width of DISPLAY's screen in pixels.
DISPLAY can be a display name or a frame.
If DISPLAY is omitted or nil, it defaults to the selected frame's display.
For character terminals, each character counts as a single pixel.
For graphical terminals, note that on \"multi-monitor\" setups this
refers to the pixel width for all physical monitors associated
with DISPLAY. To get information for each physical monitor, use
`display-monitor-attributes-list'."
(let ((frame-type (framep-on-display display)))
(cond
((memq frame-type '(x w32 ns haiku pgtk))
(x-display-pixel-width display))
(t
(frame-width (if (framep display) display (selected-frame)))))))