Make frames record when their selected window was the mini-window
When a frame in this state is selected again by Fselect_frame (but not by
Fselect_window), the mini-window rather than the frame's currently selected
window, is chosen for selection, should there still be an active minibuffer in
it.
This fixes bug #48674.
* src/frame.h (struct frame): Add new boolean field select_mini_window_flag.
* src/frame.c (make_frame): Initialize select_mini_window_flag to false.
(do_switch_frame): Set the new flag appropriately for the old frame, and
process the new frame's setting of this flag, before setting it to false.
* src/window.c (select_window): Set f->select_mini_window_flag to false.
(Fset_frame_selected_window, Fdelete_other_windows_internal)
(Fdelete_window_internal): Add comments clarifying that there is no clearing
of f->select_mini_window_flag in these functions.