frame-visible-p
frame-visible-p is a built-in function in `C source code
'.
(frame-visible-p FRAME)
Return t if FRAME is "visible" (actually in use for display).
Return the symbol `icon' if FRAME is iconified or "minimized".
Return nil if FRAME was made invisible, via `make-frame-invisible'.
On graphical displays, invisible frames are not updated and are
usually not displayed at all, even in a window system's "taskbar".
If FRAME is a text terminal frame, this always returns t.
Such frames are always considered visible, whether or not they are
currently being displayed on the terminal.