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:
parent
b87d1eabcc
commit
12dfd4a2c2
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue