window-parent

window-parent is a built-in function in `C source code'.

(window-parent &optional WINDOW)

Return the parent window of window WINDOW.
WINDOW must be a valid window and defaults to the selected one.
Return nil for a window with no parent (e.g. a root window).