From 12dfd4a2c265781bf28564dcc47914a31c59e47b Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 11 Jul 2024 16:05:01 -0600 Subject: [PATCH] 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 --- crates/gpui/src/platform/linux/x11/client.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/platform/linux/x11/client.rs b/crates/gpui/src/platform/linux/x11/client.rs index 38e17778c821b444b8b2b59e4349d8a1f7947a60..22197f2c9e1126f77f809c872f2db5289beb7b50 100644 --- a/crates/gpui/src/platform/linux/x11/client.rs +++ b/crates/gpui/src/platform/linux/x11/client.rs @@ -1169,10 +1169,13 @@ impl LinuxClient for X11Client { let cursor = match state.cursor_cache.get(&style) { Some(cursor) => *cursor, None => { - let cursor = state + let Some(cursor) = state .cursor_handle .load_cursor(&state.xcb_connection, &style.to_icon_name()) - .expect("failed to load cursor"); + .log_err() + else { + return; + }; state.cursor_cache.insert(style, cursor); cursor }