There's something very wrong with the way mouse cursors are handled on Linux. If you have a low DPI display, the Adwaita cursor is ugly and pixelated. The same cursor image in the KDE theme preview is smooth and nice.
This is a common problem in GNOME, KDE, and wlroots. Probably because they all use the same library to load the cursor and... nobody noticed?
Oh, and of course I have to take photos of the screen, because screenshots do not include the actual cursor image that is displayed.
Bonus trivia: The cross pattern you see in one of the photos is used to detect touch input.
I now have my own X cursor loader, and I have verified that the loaded data is correct. The cursor on the screen is still wrong.
I hacked wlroots to disable support for hardware cursors, and with this version of the library the cursor is displayed correctly.
This problem only seems to occur on AMD GPUs. If you look at other cursor themes, it's obvious that something is wrong with the gamma. I kind of suspected this when I noticed that the slight gradient on the black cursor was missing.
The issue is clearly visible on Steam Deck too, which also has an AMD GPU. That black cursor you have in the desktop mode? It should be gray.
You can't unsee it now.
Nvidia seems to get this almost right. However, if you take a closer look, you will see that the dark pixels are a little bit too dark. Or am I seeing things?
Photos from two different monitors and a close-up.
On Intel GPUs, the mouse pointer looks like a perfect copy of the pointer drawn in software.
@wolfpld maybe broken subpixel rendering? I don't know if Linux does it for fonts/cursors
@BartWronski It supposedly just uploads an RGBA image to be used as a cursor. The common complaint about Wayland is that it doesn't support hardware cursors. But the code I've seen says otherwise.
It works fine at high DPI, but there are subtle differences in behavior between KDE and GNOME. KDE uses the appropriately scaled cursor image depending on the DPI of the screen. GNOME seems to just load the high resolution cursor and scale it down on a low resolution screen, where it looks fine.
@BartWronski The particularly trollish thing about Wayland is that it requires every single program to provide the cursor image. The protocol has no way of specifying what theme or size the program should load. So it's especially fun when several hacky solutions are involved.
Even if you are able to fix this on the compositor side, the programs will still be using the broken library and will still provide the ugly cursors.
@BartWronski Good news though! After 15 years of Wayland being a thing, the committee has finally fixed this one little problem!
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/194
It just requires that all programs adapt to the new solution! They seriously think that updating all existing client applications is the way to go.
I believe I have an alternative solution, which is a big hack, but it will make all these problems go away.
@wolfpld The mouse cursor is a hardware overlay which goes through a totally different display path, sometimes with its own palette/gamma/etc. So if the driver team fiddle with main palette/ramp and forget to fiddle with the other to match, that'll do it!
@wolfpld I remember when amdgpu.dc defaulted to 1 (you can't set it to 0 anymore on newer GPUs) initially the mouse was tinted red; years later they fixed it.
It definitely follows a different, HW accelerated path.
@wolfpld Issue in Mesa drivers?
@AngryAnt Most likely.
@wolfpld antialiasing gone badly wrong?
@MouseByTheSea We'll find out soon enough.
@wolfpld I have the same issue with macOS when running a low dpi and high dpi monitor. It seems to be exacerbated by running Zoom.