Allow Application::run to return on native platforms
This commit is contained in:
parent
aeec0375f0
commit
08c771fa70
3 changed files with 13 additions and 7 deletions
|
|
@ -11,6 +11,7 @@ use iced_winit::futures;
|
|||
use iced_winit::futures::channel::mpsc;
|
||||
use iced_winit::{Cache, Clipboard, Debug, Proxy, Settings};
|
||||
|
||||
use crate::glutin::platform::run_return::EventLoopExtRunReturn;
|
||||
use glutin::window::Window;
|
||||
use std::mem::ManuallyDrop;
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ where
|
|||
let mut debug = Debug::new();
|
||||
debug.startup_started();
|
||||
|
||||
let event_loop = EventLoop::with_user_event();
|
||||
let mut event_loop = EventLoop::with_user_event();
|
||||
let mut proxy = event_loop.create_proxy();
|
||||
|
||||
let mut runtime = {
|
||||
|
|
@ -115,7 +116,7 @@ where
|
|||
|
||||
let mut context = task::Context::from_waker(task::noop_waker_ref());
|
||||
|
||||
event_loop.run(move |event, _, control_flow| {
|
||||
event_loop.run_return(move |event, _, control_flow| {
|
||||
use glutin::event_loop::ControlFlow;
|
||||
|
||||
if let ControlFlow::Exit = control_flow {
|
||||
|
|
@ -148,6 +149,8 @@ where
|
|||
};
|
||||
}
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run_instance<A, E, C>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue