aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mackenzie2022-05-28 12:55:32 +0000
committerAlan Mackenzie2022-05-28 12:55:32 +0000
commitf9ee83bfb9f09a32ca8c15385f0cd3ec12ebde8c (patch)
treea343a5a1dbcba985cbfc9ee0602f9d9f4d85740f /src
parent908e2e09d08c8058f40295096aec9251944875ca (diff)
downloademacs-f9ee83bfb9f09a32ca8c15385f0cd3ec12ebde8c.tar.gz
emacs-f9ee83bfb9f09a32ca8c15385f0cd3ec12ebde8c.zip
do_switch_frame: before leaving mini-window, check other (mru) window is live
This fixes bug#55684. There, with a minibuffer-only frame at start up, Emacs tried to switch to this frame, whose selected window was the mini-window. There is no other active window in this frame, so the attempt to swith to another window failed. * src/frame.c (do_switch_frame): On switching to a frame whose selected window is as above, before selecting the most recently used window, check this ostensible window is an actual live window. Otherwise leave the mini-window selected.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c
index dc8045f41e6..0c278259a79 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1568,8 +1568,14 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
1568 to a different window, the most recently used one, unless there is a 1568 to a different window, the most recently used one, unless there is a
1569 valid active minibuffer in the mini-window. */ 1569 valid active minibuffer in the mini-window. */
1570 if (EQ (f->selected_window, f->minibuffer_window) 1570 if (EQ (f->selected_window, f->minibuffer_window)
1571 /* The following test might fail if the mini-window contains a
1572 non-active minibuffer. */
1571 && NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) 1573 && NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt)))
1572 Fset_frame_selected_window (frame, call1 (Qget_mru_window, frame), Qnil); 1574 {
1575 Lisp_Object w = call1 (Qget_mru_window, frame);
1576 if (WINDOW_LIVE_P (w)) /* W can be nil in minibuffer-only frames. */
1577 Fset_frame_selected_window (frame, w, Qnil);
1578 }
1573 1579
1574 Fselect_window (f->selected_window, norecord); 1580 Fselect_window (f->selected_window, norecord);
1575 1581