Make window visible after surface creation in iced_winit
This commit is contained in:
parent
c63a81f683
commit
8c110c1be9
1 changed files with 11 additions and 1 deletions
|
|
@ -494,6 +494,8 @@ where
|
||||||
let exit_on_close_request =
|
let exit_on_close_request =
|
||||||
settings.exit_on_close_request;
|
settings.exit_on_close_request;
|
||||||
|
|
||||||
|
let visible = settings.visible;
|
||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
let target =
|
let target =
|
||||||
settings.platform_specific.target.clone();
|
settings.platform_specific.target.clone();
|
||||||
|
|
@ -507,7 +509,8 @@ where
|
||||||
.or(event_loop
|
.or(event_loop
|
||||||
.primary_monitor()),
|
.primary_monitor()),
|
||||||
self.id.clone(),
|
self.id.clone(),
|
||||||
),
|
)
|
||||||
|
.with_visible(false),
|
||||||
)
|
)
|
||||||
.expect("Create window");
|
.expect("Create window");
|
||||||
|
|
||||||
|
|
@ -563,6 +566,7 @@ where
|
||||||
id,
|
id,
|
||||||
window,
|
window,
|
||||||
exit_on_close_request,
|
exit_on_close_request,
|
||||||
|
make_visible: visible,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -612,6 +616,7 @@ enum Event<Message: 'static> {
|
||||||
id: window::Id,
|
id: window::Id,
|
||||||
window: winit::window::Window,
|
window: winit::window::Window,
|
||||||
exit_on_close_request: bool,
|
exit_on_close_request: bool,
|
||||||
|
make_visible: bool,
|
||||||
},
|
},
|
||||||
EventLoopAwakened(winit::event::Event<Message>),
|
EventLoopAwakened(winit::event::Event<Message>),
|
||||||
}
|
}
|
||||||
|
|
@ -667,6 +672,7 @@ async fn run_instance<P, C>(
|
||||||
id,
|
id,
|
||||||
window,
|
window,
|
||||||
exit_on_close_request,
|
exit_on_close_request,
|
||||||
|
make_visible,
|
||||||
} => {
|
} => {
|
||||||
let window = window_manager.insert(
|
let window = window_manager.insert(
|
||||||
id,
|
id,
|
||||||
|
|
@ -691,6 +697,10 @@ async fn run_instance<P, C>(
|
||||||
);
|
);
|
||||||
let _ = ui_caches.insert(id, user_interface::Cache::default());
|
let _ = ui_caches.insert(id, user_interface::Cache::default());
|
||||||
|
|
||||||
|
if make_visible {
|
||||||
|
window.raw.set_visible(true);
|
||||||
|
}
|
||||||
|
|
||||||
events.push((
|
events.push((
|
||||||
id,
|
id,
|
||||||
core::Event::Window(window::Event::Opened {
|
core::Event::Window(window::Event::Opened {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue