From 427d66990c5775b99d4b9f24e53e7e8da9df8f89 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:37:34 +0100 Subject: [PATCH] gpui: Do not emit MouseUpEvent when exiting drag & drop (#9273) Fixes #9198 Release Notes: - Fixed a bug where empty panes could be created during drag & drop. --- crates/gpui/src/window.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 23b01c9462836306609477488008744c2e2b4951..a047b9cbd2e001f182fb780e4537073e866d5b23 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -1157,12 +1157,10 @@ impl<'a> WindowContext<'a> { click_count: 1, }) } - FileDropEvent::Exited => PlatformInput::MouseUp(MouseUpEvent { - button: MouseButton::Left, - position: Point::default(), - modifiers: Modifiers::default(), - click_count: 1, - }), + FileDropEvent::Exited => { + self.active_drag.take(); + PlatformInput::FileDrop(FileDropEvent::Exited) + } }, PlatformInput::KeyDown(_) | PlatformInput::KeyUp(_) => event, };