diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index 83e31293a45c5451fd57f9f0b9bc0a2c25de3c93..3c582ba999c5b3733398640d5fb7835a6bc5913c 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -648,8 +648,8 @@ pub(super) unsafe fn read_fd(mut fd: filedescriptor::FileDescriptor) -> Result String { + #[cfg(any(feature = "wayland", feature = "x11"))] + pub(super) fn to_icon_name(&self) -> &'static str { // Based on cursor names from https://gitlab.gnome.org/GNOME/adwaita-icon-theme (GNOME) // and https://github.com/KDE/breeze (KDE). Both of them seem to be also derived from // Web CSS cursor names: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#values @@ -682,7 +682,6 @@ impl CursorStyle { "default" } } - .to_string() } } diff --git a/crates/gpui/src/platform/linux/wayland/client.rs b/crates/gpui/src/platform/linux/wayland/client.rs index 9cd20e76b619b14f575b038f0f52fe8816ff8690..d071479c42371f02fc35c0bd06d72768ffb2c7b9 100644 --- a/crates/gpui/src/platform/linux/wayland/client.rs +++ b/crates/gpui/src/platform/linux/wayland/client.rs @@ -704,7 +704,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_name(), scale); } } } @@ -1511,12 +1511,9 @@ impl Dispatch 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_name(), scale); } } drop(state); diff --git a/crates/gpui/src/platform/linux/x11/client.rs b/crates/gpui/src/platform/linux/x11/client.rs index 4565570f20f9005b01133bfde890eca49890e3c5..b0fbf4276d16d93b2347cee27fa1556fb55bcea1 100644 --- a/crates/gpui/src/platform/linux/x11/client.rs +++ b/crates/gpui/src/platform/linux/x11/client.rs @@ -1463,7 +1463,7 @@ impl LinuxClient for X11Client { CursorStyle::None => create_invisible_cursor(&state.xcb_connection).log_err(), _ => state .cursor_handle - .load_cursor(&state.xcb_connection, &style.to_icon_name()) + .load_cursor(&state.xcb_connection, style.to_icon_name()) .log_err(), }) else { return;