Subject: Re: bug#57264: 29.0.50; Wrong xcursor colour when over an Emacs frame

From: Visuwesh <[email-masked]>
Date: Thu, 18 Aug 2022 18:29:59 +0530

[வியாழன் ஆகஸ்ட் 18, 2022] Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> Visuwesh <[email-masked]> writes:
>
>> Almost every Xorg app I have (add mpv, sxiv and meh to the earlier list)
>> and the root window except st and Emacs shows the right cursor for me.
>
> The cursor theme you sent does not include a replacement for the default
> X cursor, so what is being displayed on the root window (given that the
> window manager did not define another) is from the default cursor font,
> not your cursor theme.

What is the default X cursor, anyway?  I thought it was XC_left_ptr [1]
and AFAICT, the theme does have left_ptr.

> mpv also does not set a cursor, but inherits the cursor from the frame
> window provided by the window manager.

I thought this would be the case in some of these programs.

> I am not familar with the other programs, but I'm sure they use the
> Xcursor library, which these days has various problems with non-ARGB
> cursor bitmaps.  Emacs does not and thus behaves correctly.
>
>> I'm using the awesome window manager here if it matters.
>
> I'm not familiar with that window manager, sorry.

I took a quick look and it seems to use xcb_cursor_load_cursor.
https://github.com/awesomeWM/awesome/blob/7a8fa9d27a7907ab81e60274c925ba65d10015aa/common/xcursor.c

>> I could invert the image but that would make it worse on every other
>> Xorg app I use.
>
> Or perhaps ask those other programs to call XRecolorCursor with the
> right colors after loading a core cursor with the Xcursor library.

Unfortunately, that would be a huge undertaking.