]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minibuffer resizing with temporarily selected frames (Bug#34317)
authorMartin Rudalics <rudalics@gmx.at>
Mon, 4 Mar 2019 09:11:53 +0000 (10:11 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Mon, 4 Mar 2019 09:11:53 +0000 (10:11 +0100)
* 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).

src/keyboard.c
src/xdisp.c

index 1bde3a13ba561fca7ddb7677b79a659abe1b36ef..760cd623f6302de7d8e0a4ed9f557b700dab6051 100644 (file)
@@ -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.  */
index d728e0f111c036156373dd22bfba66ef4d607637..ffab1ded4a586b91aab1624e9c018893a787785f 100644 (file)
@@ -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));