Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
linux: Prompt library fixes (#16850)
apricotbucket28a68a543d4379
diff --git a/Cargo.lock b/Cargo.lockindex 7d62d753934..2696913a31b 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -406,6 +406,7 @@ dependencies = ["proto","rand 0.8.5","regex",+ "release_channel","rope","schemars","search",diff --git a/crates/assistant/Cargo.toml b/crates/assistant/Cargo.tomlindex 98dfd40c742..8dc50495fa1 100644--- a/crates/assistant/Cargo.toml+++ b/crates/assistant/Cargo.toml@@ -32,8 +32,8 @@ client.workspace = trueclock.workspace = truecollections.workspace = truecommand_palette_hooks.workspace = true-db.workspace = truecontext_servers.workspace = true+db.workspace = trueeditor.workspace = truefeature_flags.workspace = truefs.workspace = true@@ -58,9 +58,11 @@ open_ai = { workspace = true, features = ["schemars"] }ordered-float.workspace = trueparking_lot.workspace = truepaths.workspace = true+picker.workspace = trueproject.workspace = trueproto.workspace = trueregex.workspace = true+release_channel.workspace = truerope.workspace = trueschemars.workspace = truesearch.workspace = true@@ -68,8 +70,8 @@ semantic_index.workspace = trueserde.workspace = trueserde_json.workspace = truesettings.workspace = true-smallvec.workspace = truesimilar.workspace = true+smallvec.workspace = truesmol.workspace = truetelemetry_events.workspace = trueterminal.workspace = true@@ -81,7 +83,6 @@ ui.workspace = trueutil.workspace = trueuuid.workspace = trueworkspace.workspace = true-picker.workspace = truezed_actions.workspace = true[dev-dependencies]diff --git a/crates/assistant/src/prompt_library.rs b/crates/assistant/src/prompt_library.rsindex a9ff11f0b24..e1de546d15d 100644--- a/crates/assistant/src/prompt_library.rs+++ b/crates/assistant/src/prompt_library.rs@@ -23,6 +23,7 @@ use language_model::{};use parking_lot::RwLock;use picker::{Picker, PickerDelegate};+use release_channel::ReleaseChannel;use rope::Rope;use serde::{Deserialize, Serialize};use settings::Settings;@@ -94,14 +95,16 @@ pub fn open_prompt_library(cx.spawn(|cx| async move {let store = store.await?;cx.update(|cx| {+ let app_id = ReleaseChannel::global(cx).app_id();let bounds = Bounds::centered(None, size(px(1024.0), px(768.0)), cx);cx.open_window(WindowOptions {titlebar: Some(TitlebarOptions {title: Some("Prompt Library".into()),- appears_transparent: !cfg!(windows),+ appears_transparent: cfg!(target_os = "macos"),traffic_light_position: Some(point(px(9.0), px(9.0))),}),+ app_id: Some(app_id.to_owned()),window_bounds: Some(WindowBounds::Windowed(bounds)),..Default::default()},diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rsindex 4e9715e0ce4..66df136268f 100644--- a/crates/gpui/src/platform.rs+++ b/crates/gpui/src/platform.rs@@ -815,7 +815,8 @@ pub struct TitlebarOptions {/// The initial title of the windowpub title: Option<SharedString>,- /// Whether the titlebar should appear transparent (macOS only)+ /// Should the default system titlebar be hidden to allow for a custom-drawn titlebar? (macOS and Windows only)+ /// Refer to [`WindowOptions::window_decorations`] on Linuxpub appears_transparent: bool,/// The position of the macOS traffic light buttonsdiff --git a/crates/gpui/src/platform/linux/wayland/client.rs b/crates/gpui/src/platform/linux/wayland/client.rsindex f591c7ecf55..40ce50ecca2 100644--- a/crates/gpui/src/platform/linux/wayland/client.rs+++ b/crates/gpui/src/platform/linux/wayland/client.rs@@ -982,7 +982,8 @@ impl Dispatch<xdg_toplevel::XdgToplevel, ObjectId> for WaylandClientStatePtr {let should_close = window.handle_toplevel_event(event);if should_close {- this.drop_window(surface_id);+ // The close logic will be handled in drop_window()+ window.close();}}}