diff --git a/src/window.c b/src/window.c index 08c3f32dff..328fcb3829 100644 --- a/src/window.c +++ b/src/window.c @@ -5725,11 +5725,8 @@ specifies the window. This takes precedence over if (EQ (window, selected_window)) /* That didn't get us anywhere; look for a window on another - visible frame. */ - do - window = Fnext_window (window, Qnil, Qt); - while (! FRAME_VISIBLE_P (XFRAME (WINDOW_FRAME (XWINDOW (window)))) - && ! EQ (window, selected_window)); + visible frame on the current terminal. */ + window = Fnext_window (window, Qnil, Qvisible); } CHECK_LIVE_WINDOW (window);