From 08c771fa703f93faf57207a6793cf70cf105de5a Mon Sep 17 00:00:00 2001 From: Andreas Hofstadler Date: Sun, 7 Nov 2021 14:32:18 +0100 Subject: Allow `Application::run` to return on native platforms --- glutin/src/application.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'glutin') diff --git a/glutin/src/application.rs b/glutin/src/application.rs index 5d10e96a..3a96cae9 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -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( -- cgit From 0648d9d234346ad0f76757ea25bf06852f5b2002 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 29 Nov 2021 14:43:07 +0700 Subject: Fix imports in `application` modules --- glutin/src/application.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'glutin') diff --git a/glutin/src/application.rs b/glutin/src/application.rs index 3a96cae9..a1165de3 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -11,7 +11,6 @@ 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; @@ -29,6 +28,7 @@ where use futures::task; use futures::Future; use glutin::event_loop::EventLoop; + use glutin::platform::run_return::EventLoopExtRunReturn; use glutin::ContextBuilder; let mut debug = Debug::new(); -- cgit