Show workspace only after initializing it

This commit is contained in:
Antonio Scandurra
2023-05-19 19:35:00 +02:00
parent 5ff49bde31
commit 5a8fb18c20
7 changed files with 10 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {
titlebar: None,
center: false,
focus: false,
show: true,
kind: WindowKind::PopUp,
is_movable: false,
screen: Some(screen),

View File

@@ -36,6 +36,7 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {
titlebar: None,
center: false,
focus: false,
show: true,
kind: WindowKind::PopUp,
is_movable: false,
screen: Some(screen),

View File

@@ -74,6 +74,7 @@ fn create_copilot_auth_window(
titlebar: None,
center: true,
focus: true,
show: true,
kind: WindowKind::Normal,
is_movable: true,
screen: None,

View File

@@ -173,6 +173,7 @@ pub struct WindowOptions<'a> {
pub titlebar: Option<TitlebarOptions<'a>>,
pub center: bool,
pub focus: bool,
pub show: bool,
pub kind: WindowKind,
pub is_movable: bool,
pub screen: Option<Rc<dyn Screen>>,
@@ -376,6 +377,7 @@ impl<'a> Default for WindowOptions<'a> {
}),
center: false,
focus: true,
show: true,
kind: WindowKind::Normal,
is_movable: true,
screen: None,

View File

@@ -614,7 +614,7 @@ impl Window {
}
if options.focus {
native_window.makeKeyAndOrderFront_(nil);
} else {
} else if options.show {
native_window.orderFront_(nil);
}

View File

@@ -805,6 +805,8 @@ impl Workspace {
.await
.log_err();
cx.update_window(workspace.window_id(), |cx| cx.activate_window());
let workspace = workspace.downgrade();
notify_if_database_failed(&workspace, &mut cx);

View File

@@ -398,7 +398,8 @@ pub fn build_window_options(
traffic_light_position: Some(vec2f(8., 8.)),
}),
center: false,
focus: true,
focus: false,
show: false,
kind: WindowKind::Normal,
is_movable: true,
bounds,