Function: frame-selected-window

Return the selected window of FRAME-OR-WINDOW.
If omitted, FRAME-OR-WINDOW defaults to the currently selected frame.
Else if FRAME-OR-WINDOW denotes a valid window, return the selected
window of that window's frame. If FRAME-OR-WINDOW denotes a live frame,
return the selected window of that frame.

(fn &optional FRAME-OR-WINDOW)