Subject: bug#70038: 29.3.50; Shift up/down in buffer with images on M-x other-window with some fonts

From: Eli Zaretskii <[email-masked]>
Date: Thu, 28 Mar 2024 07:58:46 +0200

> Cc: Rahguzar <[email-masked]>, Ramon Diaz-Uriarte <[email-masked]>
> From: Ramon Diaz-Uriarte <[email-masked]>
> Date: Wed, 27 Mar 2024 21:25:34 +0100
> 
> With some fonts, changing focus (M-x other-window) from a buffer with images, makes the content in the buffer with images to shift up and down.
> 
> I am seeing this in Debian, with both the GTK and Lucid builds, under X11.
> 
> The code below reproduces the problem. This problem has been identified while debugging a change on focus issue with pdf-tools (https://github.com/vedang/pdf-tools/pull/224#issuecomment-2014151358 and ff.)

Crystal ball says that this happens because when a frame loses focus,
we redraw the cursor as a hollow rectangle, and (for boring technical
reasons, which I can explain if someone wants to know) that hollow
cursor can have a different height than the block cursor we draw on a
selected frame.  You can verify this guess of mine if you customize
cursor-type to one of the non-default values -- the problem should go
away for any cursor-type but the default one.

If my guess is correct, fixing this is not easy (but patches are
welcome, of course), and at the time I decided to leave this rare case
be.