Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Activate Zed window on external file drop

Kirill Bulatov6c653b9c05c5
diff --git a/crates/gpui2/src/interactive.rs b/crates/gpui2/src/interactive.rs
index 2d48ec5a110..84636630f37 100644
--- a/crates/gpui2/src/interactive.rs
+++ b/crates/gpui2/src/interactive.rs
@@ -193,6 +193,12 @@ impl Deref for MouseExitEvent {
#[derive(Debug, Clone, Default)]
pub struct ExternalPaths(pub(crate) SmallVec<[PathBuf; 2]>);
+impl ExternalPaths {
+ pub fn paths(&self) -> &[PathBuf] {
+ &self.0
+ }
+}
+
impl Render for ExternalPaths {
type Element = Div;
diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs
index 12d67156535..cab41067ce5 100644
--- a/crates/gpui2/src/window.rs
+++ b/crates/gpui2/src/window.rs
@@ -1284,6 +1284,7 @@ impl<'a> WindowContext<'a> {
})
}
FileDropEvent::Submit { position } => {
+ self.activate(true);
self.window.mouse_position = position;
InputEvent::MouseUp(MouseUpEvent {
button: MouseButton::Left,