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

From: Po Lu <[email-masked]>
Date: Tue, 21 Sep 2021 20:46:55 +0800

Eli Zaretskii <[email-masked]> writes:

> Specifically, I now think the adjustment should happen in this
> fragment from show_mouse_face, before we call display_and_set_cursor:
>
> 	/* When we've written over the cursor, arrange for it to
> 	   be displayed again.  */
> 	if (FRAME_WINDOW_P (f)
> 	    && phys_cursor_on_p && !w->phys_cursor_on_p)
> 	  {
>   #ifdef HAVE_WINDOW_SYSTEM
> 	    int hpos = w->phys_cursor.hpos;
>
> 	    /* When the window is hscrolled, cursor hpos can legitimately be
> 	       out of bounds, but we draw the cursor at the corresponding
> 	       window margin in that case.  */
> 	    if (!row->reversed_p && hpos < 0)
> 	      hpos = 0;
> 	    if (row->reversed_p && hpos >= row->used[TEXT_AREA])
> 	      hpos = row->used[TEXT_AREA] - 1;
>
> 	    block_input ();
> 	    display_and_set_cursor (w, true, hpos, w->phys_cursor.vpos,
> 				    w->phys_cursor.x, w->phys_cursor.y);
> 	    unblock_input ();
>   #endif	/* HAVE_WINDOW_SYSTEM */
> 	  }

Thanks, one question though: within this block, w->phys_cursor.vpos is
0! How should I go about determining whether or not the cursor is inside
`row' ATM?