linux: Add mouse cursor icon name synonyms (#32820)

Most of the default icon sets on Ubuntu do not use the names that were
there. To fix, using the icon synonyms from the chromium source. This
will probably fix some of the linux mouse cursor issues tracked in
#26141

Also adds a note in the load failure logs mentioning that misconfigured
`XCURSOR_PATH` may be the issue. I ran into this because [the alacritty
snap incorrectly sets
XCURSOR_PATH](https://github.com/snapcrafters/alacritty/issues/21).

On X11 also adds:

* Caching of load errors to log once for missing cursor icons.

* Fallback on default cursor icon. This way if there was a transition
from a non-default icon to a missing icon it doesn't get stuck showing
the non-default icon.

Leaving release notes blank as I have other mouse cursor fixes and would
prefer to just have one entry in the release notes.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-06-16 21:39:10 -06:00 committed by GitHub
parent dfa7ed55be
commit c95e2a2f1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 173 additions and 83 deletions

View file

@ -730,7 +730,7 @@ impl LinuxClient for WaylandClient {
let scale = focused_window.primary_output_scale();
state
.cursor
.set_icon(&wl_pointer, serial, style.to_icon_name(), scale);
.set_icon(&wl_pointer, serial, style.to_icon_names(), scale);
}
}
}
@ -1530,9 +1530,12 @@ impl Dispatch<wl_pointer::WlPointer, ()> for WaylandClientStatePtr {
cursor_shape_device.set_shape(serial, style.to_shape());
} else {
let scale = window.primary_output_scale();
state
.cursor
.set_icon(&wl_pointer, serial, style.to_icon_name(), scale);
state.cursor.set_icon(
&wl_pointer,
serial,
style.to_icon_names(),
scale,
);
}
}
drop(state);