Work with window handles instead of ids in drag code

This commit is contained in:
Nathan Sobo 2023-08-08 11:12:32 -06:00
parent d896d89842
commit da7dc9c880
5 changed files with 34 additions and 34 deletions

View file

@ -48,7 +48,7 @@ impl TerminalPanel {
fn new(workspace: &Workspace, cx: &mut ViewContext<Self>) -> Self {
let weak_self = cx.weak_handle();
let pane = cx.add_view(|cx| {
let window_id = cx.window_id();
let window = cx.window();
let mut pane = Pane::new(
workspace.weak_handle(),
workspace.project().clone(),
@ -60,7 +60,7 @@ impl TerminalPanel {
pane.set_can_navigate(false, cx);
pane.on_can_drop(move |drag_and_drop, cx| {
drag_and_drop
.currently_dragged::<DraggedItem>(window_id)
.currently_dragged::<DraggedItem>(window)
.map_or(false, |(_, item)| {
item.handle.act_as::<TerminalView>(cx).is_some()
})