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.

Ensure that new view observers are called by WindowContext::replace_root_view

Max Brunsfeldc81e89a4f40a
diff --git a/crates/gpui2/src/window.rs b/crates/gpui2/src/window.rs
index 1b2669b40c5..365338611b6 100644
--- a/crates/gpui2/src/window.rs
+++ b/crates/gpui2/src/window.rs
@@ -1926,14 +1926,9 @@ impl VisualContext for WindowContext<'_> {
where
V: 'static + Render,
{
- let slot = self.app.entities.reserve();
- let view = View {
- model: slot.clone(),
- };
- let mut cx = ViewContext::new(&mut *self.app, &mut *self.window, &view);
- let entity = build_view(&mut cx);
- self.entities.insert(slot, entity);
+ let view = self.build_view(build_view);
self.window.root_view = Some(view.clone().into());
+ self.notify();
view
}
diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs
index 4f911d1073d..95b05f314e7 100644
--- a/crates/workspace2/src/workspace2.rs
+++ b/crates/workspace2/src/workspace2.rs
@@ -600,11 +600,6 @@ impl Workspace {
let modal_layer = cx.build_view(|_| ModalLayer::new());
- // todo!()
- // cx.update_default_global::<DragAndDrop<Workspace>, _, _>(|drag_and_drop, _| {
- // drag_and_drop.register_container(weak_handle.clone());
- // });
-
let mut active_call = None;
if cx.has_global::<Model<ActiveCall>>() {
let call = cx.global::<Model<ActiveCall>>().clone();