Subject: bug#75930: 30.0.92; Setting default frame background color messes up mouse pointer

From: Eli Zaretskii <[email-masked]>
Date: Sat, 01 Feb 2025 10:32:39 +0200

> From: Lars Rustand <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Sat, 01 Feb 2025 00:14:47 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> >
> > So now I'm confused: why is this a bug?
> 
> I don't know why you are suddenly confused, because the description of
> the bug has not changed. I have simply located the exact parts of the
> code responsible for (one half of) the problem, i.e. the cause of the
> mouse pointer border color being set to the frame background color.

I'm confused because what you found seems to mean Emacs works as
(should be) expected.  See below.

> After finding the code I pointed to in my previous message, I realized
> that this is in fact a two-part problem.
> 
> Part 1 is that x_set_mouse_color incorrectly uses the background color
> of the current (or default?) frame as the color of the border/outline
> of the mouse pointer. This makes that border in effect become
> completely invisible when hovering over the emacs frame, which can make
> the mouse pointer very hard to see.

What would you propose as an the alternative?

> Part 2 is that the act of setting a default frame background color
> causes x_set_mouse_color to even be called in the first place. The mouse
> color should obviously not be changed as a side effect of changing the
> frame background color. These are two very different things that has
> nothing to do with eachother.
> 
> 
> I have identified the cause of part 1, but I have not (yet) found the
> cause of part 2.

I think part 2 happens as part of frame-set-background-mode, as I
mentioned up-thread, and it makes sense to me.

What this might mean is that if you don't want the effect the original
recipe produces, you should call set-mouse-color again after
set-background-color.