From 45945a7bc28eacb6d38ae5fd75203069d6bfd14f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 13 Aug 1994 23:13:10 +0000 Subject: [PATCH] (window_loop, case UNSHOW_BUFFER): When we delete a frame, skip all the windows on that frame. --- src/window.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index 22db914d7f6..cf5aa8db7cd 100644 --- a/src/window.c +++ b/src/window.c @@ -1337,7 +1337,26 @@ window_loop (type, obj, mini, frames) if (EQ (w, FRAME_ROOT_WINDOW (f)) && !NILP (XWINDOW (w)->dedicated) && other_visible_frames (f)) - Fdelete_frame (WINDOW_FRAME (XWINDOW (w)), Qnil); + { + /* Skip the other windows on this frame. + There might be one, the minibuffer! */ + if (! EQ (w, last_window)) + while (f == XFRAME (WINDOW_FRAME (XWINDOW (next_window)))) + { + /* As we go, check for the end of the loop. + We mustn't start going around a second time. */ + if (EQ (next_window, last_window)) + { + last_window = w; + break; + } + next_window = Fnext_window (next_window, + mini ? Qt : Qnil, + frame_arg); + } + /* Now we can safely delete the frame. */ + Fdelete_frame (WINDOW_FRAME (XWINDOW (w)), Qnil); + } else #endif { -- 2.39.5