Subject: bug#75931: 31.0.50; mouse-face and pointer properties make pointer change back and forth

From: Eli Zaretskii <[email-masked]>
Date: Thu, 30 Jan 2025 14:25:13 +0200

> Date: Thu, 30 Jan 2025 09:05:23 -0300
> Cc: [email-masked], Po Lu <[email-masked]>
> From: Mauro Aranda <[email-masked]>
> 
> On 30/1/25 08:36, Eli Zaretskii wrote:
>  >> Perhaps it is the call to show_mouse_face that was added to
>  >> erase_phys_cursor.
>  >
>  > Yes, I think so.  If you arrange for that call to show_mouse_face to
>  > not redefine the mouse cursor near the end of show_mouse_face, does
>  > the problem go away? or do you still need to revert those two lines in
>  > dispnew.c added by my changes?
> 
> I've no idea how to do that.  So, I did something silly:
> In show_mouse_face, when draw is DRAW_MOUSE_FACE, I changed:
> FRAME_OUTPUT_DATA (f)->hand_cursor
> to:
> FRAME_OUTPUT_DATA (f)->current_cursor

That's what I had in mind, thanks.

> With that change, I don't need to revert the changes in dispnew.c.

Good, so we now need to arrange that this particular call to
show_mouse_face doesn't touch the mouse cursor shape.  Let's see what
Po Lu says about that.  If he agrees that there's no need to redefine
the cursor in this particular call of show_mouse_face, the technical
solution is simple.

> But I'm way out of my league here, so I don't know if the change is
> correct, most probably not.  What seems correct is not specifying
> hand_cursor, but rather find out which cursor do we need to draw when
> redrawing it...

That'd be the fallback plan, but it would require to refactor the code
in note_mouse_highlight, and in particular move the code which
determines the pointer shape into show_mouse_face (which will make it
more expensive), and also other changes, since show_mouse_face is
called from several places.  Let's hope this will not be necessary.