Skip to content

Commit

Permalink
Make window invisible until the first render
Browse files Browse the repository at this point in the history
  • Loading branch information
HKalbasi committed Oct 29, 2023
1 parent d4e6876 commit 489042a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/desktop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ pub fn launch_with_props<P: 'static>(root: Component<P>, props: P, cfg: Config)
EventData::Ipc(msg) if msg.method() == "initialize" => {
let view = webviews.get_mut(&event.1).unwrap();
send_edits(view.dom.rebuild(), &view.desktop_context.webview);
view.desktop_context.webview.window().set_visible(true);
}

EventData::Ipc(msg) if msg.method() == "browser_open" => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/src/webview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn build(
proxy: EventLoopProxy<UserWindowEvent>,
) -> (WebView, WebContext) {
let builder = cfg.window.clone();
let window = builder.build(event_loop).unwrap();
let window = builder.with_visible(false).build(event_loop).unwrap();
let file_handler = cfg.file_drop_handler.take();
let custom_head = cfg.custom_head.clone();
let index_file = cfg.custom_index.clone();
Expand Down

0 comments on commit 489042a

Please sign in to comment.