Subject: Re: bug#23124: Two minibuffer resize related bugs

From: Eli Zaretskii <[email-masked]>
Date: Tue, 29 Mar 2016 19:44:54 +0300

> Date: Tue, 29 Mar 2016 18:02:19 +0200
> From: martin rudalics <[email-masked]>
> CC: [email-masked]
> 
>  >>   >> At this moment "nothing" happens here (Bug#1).  When I now switch (via
>  >>   >> Alt TAB) to the new frame (the one created via C-x 5 2), the message
>  >>   >> appears there.  When I now type C-p in the new frame, the minibuffer
>  >>   >> window shrinks back but the space previously occupied by the modeline of
>  >>   >> the window above is not redrawn, hence I get two modelines above each
>  >>   >> other (Bug#2).
>  >>
>  >> I've now traced this behavior back to this
>  >
>  > "This behavior" being what? both the "nothing happens" part and the
>  > "duplicate mode line" part?
> 
> Yes, both.
> 
>  >> In fact, removing the
>  >>
>  >>         x_consider_frame_title (w->frame);
>  >>
>  >> call from redisplay_window fixes both bugs here.
>  >
>  > Can you explain how the call to x_consider_frame_title causes problems
>  > with the echo area and the mode line?
> 
> Be assured I would have done that if I had found a clue.

I think I might have.  Does the patch below give good results?

diff --git a/src/xdisp.c b/src/xdisp.c
index d701306..bf8068b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -17082,7 +17082,10 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
 	    ignore_mouse_drag_p = true;
 #endif
         }
+      ptrdiff_t count1 = SPECPDL_INDEX ();
+      specbind (Qinhibit_redisplay, Qt);
       x_consider_frame_title (w->frame);
+      unbind_to (count1, Qnil);
 #endif
     }