summaryrefslogtreecommitdiff
path: root/src/minibuf.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-10-12 17:06:33 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-10-12 17:06:33 -0400
commitda752c04664c0e22a2f6b4a41dfa1fed4d5276ff (patch)
tree927f868b9b1d5bc1be370e3195082503fc3d83e7 /src/minibuf.c
parent5a94a2e5b054f6866762f6eb7f7bbafd24bf02de (diff)
downloademacs-da752c04664c0e22a2f6b4a41dfa1fed4d5276ff.tar.gz
src/frame.c (do_switch_frame): Fix bug#58343
* src/frame.c (do_switch_frame): Move call to `get-mru-window` outside of the "critical region" where (selected-window) != (frame-selected-window). * src/minibuf.c (move_minibuffers_onto_frame): Add arg `frame`. Use it instead of `selected_frame`. Adjust all callers. * src/lisp.h (move_minibuffers_onto_frame): Adjust declaration.
Diffstat (limited to 'src/minibuf.c')
-rw-r--r--src/minibuf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index bedc5644807..3f34b1b0834 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -187,13 +187,15 @@ zip_minibuffer_stacks (Lisp_Object dest_window, Lisp_Object source_window)
/* If `minibuffer_follows_selected_frame' is t, or we're about to
delete a frame which potentially "contains" minibuffers, move them
- from the old frame to the selected frame. This function is
+ from the old frame to the to-be-selected frame. This function is
intended to be called from `do_switch_frame' in frame.c. OF is the
- old frame, FOR_DELETION is true if OF is about to be deleted. */
+ old frame, FRAME is the to-be-selected frame, and FOR_DELETION is true
+ if OF is about to be deleted. */
void
-move_minibuffers_onto_frame (struct frame *of, bool for_deletion)
+move_minibuffers_onto_frame (struct frame *of, Lisp_Object frame,
+ bool for_deletion)
{
- struct frame *f = XFRAME (selected_frame);
+ struct frame *f = XFRAME (frame);
minibuf_window = f->minibuffer_window;
if (!(minibuf_level
@@ -206,7 +208,7 @@ move_minibuffers_onto_frame (struct frame *of, bool for_deletion)
{
zip_minibuffer_stacks (f->minibuffer_window, of->minibuffer_window);
if (for_deletion && XFRAME (MB_frame) != of)
- MB_frame = selected_frame;
+ MB_frame = frame;
}
}