diff options
Diffstat (limited to 'glutin/src')
| -rw-r--r-- | glutin/src/application.rs | 25 | 
1 files changed, 19 insertions, 6 deletions
| diff --git a/glutin/src/application.rs b/glutin/src/application.rs index 24f315fb..054cf839 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -54,13 +54,17 @@ where          runtime.enter(|| A::new(flags))      }; +    let should_be_visible = settings.window.visible; +      let context = { -        let builder = settings.window.into_builder( -            &application.title(), -            application.mode(), -            event_loop.primary_monitor(), -            settings.id, -        ); +        let builder = settings +            .window +            .into_builder( +                &application.title(), +                event_loop.primary_monitor(), +                settings.id, +            ) +            .with_visible(false);          log::info!("Window builder: {:#?}", builder); @@ -135,6 +139,7 @@ where          receiver,          context,          init_command, +        should_be_visible,          settings.exit_on_close_request,      )); @@ -187,6 +192,7 @@ async fn run_instance<A, E, C>(      mut receiver: mpsc::UnboundedReceiver<glutin::event::Event<'_, A::Message>>,      mut context: glutin::ContextWrapper<glutin::PossiblyCurrent, Window>,      init_command: Command<A::Message>, +    should_be_visible: bool,      exit_on_close_request: bool,  ) where      A: Application + 'static, @@ -200,6 +206,7 @@ async fn run_instance<A, E, C>(      let mut clipboard = Clipboard::connect(context.window());      let mut cache = user_interface::Cache::default();      let mut state = application::State::new(&application, context.window()); +    let mut visible = false;      let mut viewport_version = state.viewport_version();      application::run_command( @@ -399,6 +406,12 @@ async fn run_instance<A, E, C>(                  debug.render_finished(); +                if !visible && should_be_visible { +                    context.window().set_visible(true); + +                    visible = true; +                } +                  // TODO: Handle animations!                  // Maybe we can use `ControlFlow::WaitUntil` for this.              } | 
