From 6c653b9c05c546d58bd9f6358938f8f0c9d1a54e Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 7 Dec 2023 15:18:23 +0200 Subject: [PATCH] Activate Zed window on external file drop --- crates/gpui2/src/interactive.rs | 6 ++++++ crates/gpui2/src/window.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/crates/gpui2/src/interactive.rs b/crates/gpui2/src/interactive.rs index 2d48ec5a1100e61d493dd4ac92864915e4ce70bb..84636630f37b7216b94b85be68d52d1122c019b4 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 12d6715653574336de06cef1e1a0390742318c1c..cab41067ce576dcab09d12537ab1da665dba4be4 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,