aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2019-03-04 10:11:53 +0100
committerMartin Rudalics2019-03-04 10:11:53 +0100
commita810a75aa2d0cd5f43ec4b733fdcafabbfe8c5c3 (patch)
tree1fc14d1682958f204e8e0e8d514f230e22566650 /src
parent716ff449ef0ee87e7a102733d8c036bc8e037076 (diff)
downloademacs-a810a75aa2d0cd5f43ec4b733fdcafabbfe8c5c3.tar.gz
emacs-a810a75aa2d0cd5f43ec4b733fdcafabbfe8c5c3.zip
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).
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c8
-rw-r--r--src/xdisp.c19
2 files changed, 19 insertions, 8 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 1bde3a13ba5..760cd623f63 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1476,8 +1476,12 @@ command_loop_1 (void)
1476 safe_run_hooks (Qpost_command_hook); 1476 safe_run_hooks (Qpost_command_hook);
1477 1477
1478 /* If displaying a message, resize the echo area window to fit 1478 /* If displaying a message, resize the echo area window to fit
1479 that message's size exactly. */ 1479 that message's size exactly. Do this only if the echo area
1480 if (!NILP (echo_area_buffer[0])) 1480 window is the minibuffer window of the selected frame. See
1481 Bug#34317. */
1482 if (!NILP (echo_area_buffer[0])
1483 && (EQ (echo_area_window,
1484 FRAME_MINIBUF_WINDOW (XFRAME (selected_frame)))))
1481 resize_echo_area_exactly (); 1485 resize_echo_area_exactly ();
1482 1486
1483 /* If there are warnings waiting, process them. */ 1487 /* If there are warnings waiting, process them. */
diff --git a/src/xdisp.c b/src/xdisp.c
index d728e0f111c..ffab1ded4a5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12062,19 +12062,26 @@ x_consider_frame_title (Lisp_Object frame)
12062 /* Set global variable indicating that multiple frames exist. */ 12062 /* Set global variable indicating that multiple frames exist. */
12063 multiple_frames = CONSP (tail); 12063 multiple_frames = CONSP (tail);
12064 12064
12065 /* Switch to the buffer of selected window of the frame. Set up
12066 mode_line_target so that display_mode_element will output into
12067 mode_line_noprop_buf; then display the title. */
12068 record_unwind_protect (unwind_format_mode_line,
12069 format_mode_line_unwind_data
12070 (f, current_buffer, selected_window, false));
12071 /* select-frame calls resize_mini_window, which could resize the 12065 /* select-frame calls resize_mini_window, which could resize the
12072 mini-window and by that undo the effect of this redisplay 12066 mini-window and by that undo the effect of this redisplay
12073 cycle wrt minibuffer and echo-area display. Binding 12067 cycle wrt minibuffer and echo-area display. Binding
12074 inhibit-redisplay to t makes the call to resize_mini_window a 12068 inhibit-redisplay to t makes the call to resize_mini_window a
12075 no-op, thus avoiding the adverse side effects. */ 12069 no-op, thus avoiding the adverse side effects. */
12070
12071 /* The following was moved before the record_unwind_protect form
12072 below to inhibit redisplay also when restoring the selected
12073 window/frame: This avoids that resize_mini_window sizes back
12074 the minibuffer window of a temporarily selected frame. See
12075 Bug#34317. */
12076 specbind (Qinhibit_redisplay, Qt); 12076 specbind (Qinhibit_redisplay, Qt);
12077 12077
12078 /* Switch to the buffer of selected window of the frame. Set up
12079 mode_line_target so that display_mode_element will output into
12080 mode_line_noprop_buf; then display the title. */
12081 record_unwind_protect (unwind_format_mode_line,
12082 format_mode_line_unwind_data
12083 (f, current_buffer, selected_window, false));
12084
12078 Fselect_window (f->selected_window, Qt); 12085 Fselect_window (f->selected_window, Qt);
12079 set_buffer_internal_1 12086 set_buffer_internal_1
12080 (XBUFFER (XWINDOW (f->selected_window)->contents)); 12087 (XBUFFER (XWINDOW (f->selected_window)->contents));