Commit a810a75a authored by Martin Rudalics's avatar Martin Rudalics

Fix minibuffer resizing with temporarily selected frames (Bug#34317)

* src/keyboard.c (command_loop_1): Resize echo area exactly
only if the echo area window is the minibuffer window of the
selected frame (Bug#34317).
* src/xdisp.c (x_consider_frame_title): Inhibit redisplay also
when restoring the selected window/frame to avoid that
resize_mini_window sizes back the minibuffer window of a
temporarily selected frame (Bug#34317).
parent 716ff449
Pipeline #911 failed with stage
in 51 minutes and 31 seconds
......@@ -1476,8 +1476,12 @@ command_loop_1 (void)
safe_run_hooks (Qpost_command_hook);
/* If displaying a message, resize the echo area window to fit
that message's size exactly. */
if (!NILP (echo_area_buffer[0]))
that message's size exactly. Do this only if the echo area
window is the minibuffer window of the selected frame. See
Bug#34317. */
if (!NILP (echo_area_buffer[0])
&& (EQ (echo_area_window,
FRAME_MINIBUF_WINDOW (XFRAME (selected_frame)))))
resize_echo_area_exactly ();
/* If there are warnings waiting, process them. */
......
......@@ -12062,19 +12062,26 @@ x_consider_frame_title (Lisp_Object frame)
/* Set global variable indicating that multiple frames exist. */
multiple_frames = CONSP (tail);
/* Switch to the buffer of selected window of the frame. Set up
mode_line_target so that display_mode_element will output into
mode_line_noprop_buf; then display the title. */
record_unwind_protect (unwind_format_mode_line,
format_mode_line_unwind_data
(f, current_buffer, selected_window, false));
/* select-frame calls resize_mini_window, which could resize the
mini-window and by that undo the effect of this redisplay
cycle wrt minibuffer and echo-area display. Binding
inhibit-redisplay to t makes the call to resize_mini_window a
no-op, thus avoiding the adverse side effects. */
/* The following was moved before the record_unwind_protect form
below to inhibit redisplay also when restoring the selected
window/frame: This avoids that resize_mini_window sizes back
the minibuffer window of a temporarily selected frame. See
Bug#34317. */
specbind (Qinhibit_redisplay, Qt);
/* Switch to the buffer of selected window of the frame. Set up
mode_line_target so that display_mode_element will output into
mode_line_noprop_buf; then display the title. */
record_unwind_protect (unwind_format_mode_line,
format_mode_line_unwind_data
(f, current_buffer, selected_window, false));
Fselect_window (f->selected_window, Qt);
set_buffer_internal_1
(XBUFFER (XWINDOW (f->selected_window)->contents));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment