+By default, only the windows in the selected frame are considered.
+The optional argument @var{which-frames} changes this behavior.
+Here are the possible values and their meanings:
+
+@table @asis
+@item @code{nil}
+Consider all the windows in the selected windows's frame, plus the
+minibuffer used by that frame even if it lies in some other frame.
+
+@item @code{t}
+Consider all windows in all existing frames.
+
+@item @code{visible}
+Consider all windows in all visible frames. (To get useful results, you
+must ensure @var{window} is in a visible frame.)
+
+@item @code{0}
+Consider all windows in all visible or iconified frames.
+
+@item @var{frame}
+Consider all windows on frame @var{frame}.
+
+@item anything else
+Consider precisely the windows in the selected window's frame, and no others.
+@end table
+
+The optional argument @var{which-devices} further clarifies on which
+devices to search for frames as specified by @var{which-frames}.
+This value is only meaningful if @var{which-frames} is non-@code{nil}.
+
+@table @asis
+@item @code{nil}
+Consider all devices on the selected console.
+
+@item @var{device}
+Consider only the one device @var{device}.
+
+@item @var{console}
+Consider all devices on @var{console}.
+
+@item @var{device-type}
+Consider all devices with device type @var{device-type}.
+
+@item @code{window-system}
+Consider all devices on window system consoles.
+
+@item anything else
+Consider all devices without restriction.
+@end table