Function: frame-list-z-order
frame-list-z-order is a byte-compiled function defined in frame.el.gz.
Signature
(frame-list-z-order &optional DISPLAY)
Documentation
Return list of Emacs's frames, in Z (stacking) order.
The optional argument DISPLAY specifies which display to poll. DISPLAY should be either a frame or a display name (a string). If omitted or nil, that stands for the selected frame's display.
Frames are listed from topmost (first) to bottommost (last). As a special case, if DISPLAY is non-nil and specifies a live frame, return the child frames of that frame in Z (stacking) order.
Return nil if DISPLAY contains no Emacs frame.
Probably introduced at or before Emacs version 26.1.
Source Code
;; Defined in /usr/src/emacs/lisp/frame.el.gz
(defun frame-list-z-order (&optional display)
"Return list of Emacs's frames, in Z (stacking) order.
The optional argument DISPLAY specifies which display to poll.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display.
Frames are listed from topmost (first) to bottommost (last). As
a special case, if DISPLAY is non-nil and specifies a live frame,
return the child frames of that frame in Z (stacking) order.
Return nil if DISPLAY contains no Emacs frame."
(let ((frame-type (framep-on-display display)))
(cond
((eq frame-type 'x)
(x-frame-list-z-order display))
((eq frame-type 'w32)
(w32-frame-list-z-order display))
((eq frame-type 'ns)
(ns-frame-list-z-order display))
((eq frame-type 'pgtk)
;; This is currently not supported on PGTK.
;; (pgtk-frame-list-z-order display)
nil)
((eq frame-type 'haiku)
(haiku-frame-list-z-order display))
((eq frame-type 'android)
(android-frame-list-z-order display)))))