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,