Merge remote-tracking branch 'origin/master' into feat/multi-window-support

# Conflicts:
#	native/src/command/action.rs
#	native/src/window/action.rs
#	winit/src/window.rs
This commit is contained in:
Bingus 2023-02-15 14:55:02 -08:00
commit 63fb608d8b
No known key found for this signature in database
GPG key ID: 5F84D2AA40A9F170
55 changed files with 1218 additions and 224 deletions

View file

@ -145,11 +145,15 @@ where
#[cfg(target_arch = "wasm32")]
let target = settings.window.platform_specific.target.clone();
let builder = settings.window.into_builder(
&application.title(),
event_loop.primary_monitor(),
settings.id,
);
let should_be_visible = settings.window.visible;
let builder = settings
.window
.into_builder(
&application.title(),
event_loop.primary_monitor(),
settings.id,
)
.with_visible(false);
log::info!("Window builder: {:#?}", builder);
@ -200,6 +204,7 @@ where
control_sender,
init_command,
window,
should_be_visible,
settings.exit_on_close_request,
);
@ -266,6 +271,7 @@ async fn run_instance<A, E, C>(
mut control_sender: mpsc::UnboundedSender<winit::event_loop::ControlFlow>,
init_command: Command<A::Message>,
window: winit::window::Window,
should_be_visible: bool,
exit_on_close_request: bool,
) where
A: Application + 'static,
@ -293,6 +299,10 @@ async fn run_instance<A, E, C>(
physical_size.height,
);
if should_be_visible {
window.set_visible(true);
}
run_command(
&application,
&mut cache,
@ -534,7 +544,7 @@ async fn run_instance<A, E, C>(
Err(error) => match error {
// This is an unrecoverable error.
compositor::SurfaceError::OutOfMemory => {
panic!("{:?}", error);
panic!("{error:?}");
}
_ => {
debug.render_finished();
@ -754,7 +764,7 @@ pub fn run_command<A, E>(
y,
});
}
window::Action::SetMode(mode) => {
window::Action::ChangeMode(mode) => {
window.set_visible(conversion::visible(mode));
window.set_fullscreen(conversion::fullscreen(
window.primary_monitor(),