Subject: bug#38181: Actual height of mode-line not taken into account

From: Eli Zaretskii <[email-masked]>
Date: Fri, 15 Nov 2019 17:11:19 +0200

> From: Jonas Bernoulli <[email-masked]>
> Cc: [email-masked]
> Date: Fri, 15 Nov 2019 15:24:11 +0100
> 
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > So much for theory.  Now for the practical aspects: how bad is it to
> > have to invoke redisplay by hand in these cases?  After all, they
> > don't sound like something a Lisp program would do frequently.
> 
> Currently I do the manual redisplay by advising fit-window-to-buffer,
> which I don't think can be avoided.  This results in some flickering,
> so I make sure it is only done once per buffer.

Why the need to use advising?  Your recipe shows that calling
redisplay before fit-window-to-buffer also solves the problem.  Can't
you do something like that only when you add such tall images to the
mode line?

An alternative would be to scale the image so that it doesn't enlarge
the mode line, btw.  Is that possible in your use cases?