Subject: bug#50660: 28.0.50; Text artifacting when the cursor moves over text under mouse face that originally displayed a box

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Oct 2021 10:26:51 +0300

> From: Po Lu <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 16 Oct 2021 15:13:18 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > I don't understand: if the mouse-face changes the font, you want to
> > ignore that? why does that make sense?
> >
> > And mouse-face is defined for ASCII font only anyway, which is why the
> > code calls FACE_FOR_CHAR.  You want to ignore the font that this call
> > produces?
> 
> Yes, precisely.
> 
> > A face includes the font, so I don't understand why you want to
> > separate them, and how.
> >
> > As for the old code: are you sure that's not a bug, part of the same
> > subtle issue you are trying to fix?
> 
> I'm reasonably sure.  Under the old code in *term, moving the mouse over
> the entry for `glyphless-char' in list-faces-display results in nothing,
> while under the new code (where s->font == s->face->font even under
> mouse face) the section under mouse face overlaps with its surroundings
> and is otherwise glitchy, because the mouse face's font is larger than
> the original face's font.

In the examples I used for testing the size of the font was the same,
so I'm no longer sure we are talking about the same thing.

I also asked to describe what exactly you found that causes the
artifacts I described when I installed the previous patch -- could you
please provide that description?  Because I'm no longer sure I
understand what is the problem with the existing code you are trying
to fix now.

AFAIU, the issue is with displaying the cursor inside mouse-face, and
that involves redrawing the character on which the cursor is
displayed, so that must use the same font as the one we used to
display the character itself, and use the same font.  But mouse-face's
font is not necessarily appropriate for every character shown in that
face.

Thanks.