Don't panic on unknown cursor style on x11 (#14264)

Release Notes:

- linux: Fixed a panic if we request a cursor style your system doesn't
support
This commit is contained in:
Conrad Irwin 2024-07-11 16:05:01 -06:00 committed by GitHub
parent b87d1eabcc
commit 12dfd4a2c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1169,10 +1169,13 @@ impl LinuxClient for X11Client {
let cursor = match state.cursor_cache.get(&style) { let cursor = match state.cursor_cache.get(&style) {
Some(cursor) => *cursor, Some(cursor) => *cursor,
None => { None => {
let cursor = state let Some(cursor) = state
.cursor_handle .cursor_handle
.load_cursor(&state.xcb_connection, &style.to_icon_name()) .load_cursor(&state.xcb_connection, &style.to_icon_name())
.expect("failed to load cursor"); .log_err()
else {
return;
};
state.cursor_cache.insert(style, cursor); state.cursor_cache.insert(style, cursor);
cursor cursor
} }