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.

workspace: Respect minimized state when deserializing workspaces (#24127)

Piotr Osiewicz6b48a6e690d0
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 9aeba2a22e5..4d9ad08c82e 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -332,6 +332,7 @@ pub fn init(cx: &mut App) {
app_state,
cx,
|workspace, window, cx| {
+ cx.activate(true);
Editor::new_file(workspace, &Default::default(), window, cx)
},
)
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 095abcb061d..d052f558920 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -1284,10 +1284,7 @@ impl Workspace {
.unwrap_or_default();
window
- .update(&mut cx, |_, window, cx| {
- window.activate_window();
- cx.activate(true);
- })
+ .update(&mut cx, |_, window, _| window.activate_window())
.log_err();
Ok((window, opened_items))
})
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs
index 7bedb1b9945..5d90d582c94 100644
--- a/crates/zed/src/zed.rs
+++ b/crates/zed/src/zed.rs
@@ -796,6 +796,7 @@ fn register_actions(
app_state,
cx,
|workspace, window, cx| {
+ cx.activate(true);
Editor::new_file(workspace, &Default::default(), window, cx)
},
)