From 7714982a9d7c9dc1803cd7ab6291d1343436d2c6 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:03:30 -0600 Subject: [PATCH] Don't panic on unknown cursor style on x11 (cherry-pick #14264) (#14273) Cherry-picked 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 Co-authored-by: Conrad Irwin --- 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 2345ac59b2a36d833112d318e7dbb40d55013ecd..b9ebf6a7dfe290e8d7e2bb2284388fb171bb3828 100644 --- a/crates/gpui/src/platform/linux/x11/client.rs +++ b/crates/gpui/src/platform/linux/x11/client.rs @@ -1154,10 +1154,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 }