diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index 40e7fb839..3d8f9062d 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -1096,10 +1096,8 @@ mod glow_integration { .and_then(|w| w.read().window.clone()) }, ); - return; } } - render(&egui_ctx); }, ); @@ -2071,10 +2069,8 @@ mod wgpu_integration { *focused.read(), |id| _windows.read().get(&id).and_then(|w| w.0.clone()), ); - return; } } - render(&egui_ctx); }, ); diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index abacadbf9..1040e48db 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -615,10 +615,10 @@ impl<'open> Window<'open> { ctx.request_repaint_viewport(ctx.get_parent_viewport_id()); } - Some(InnerResponse { + InnerResponse { inner: content_inner, response: full_response, - }) + } }); } } diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index 775d431ea..96b834150 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -2289,7 +2289,7 @@ impl Context { &self, viewport_builder: ViewportBuilder, func: impl FnOnce(&Context) -> T, - ) -> T { + ) -> Option { if !self.force_embedding() { let mut viewport_id = ViewportId::MAIN; let mut parent_viewport_id = ViewportId::MAIN; @@ -2326,9 +2326,9 @@ impl Context { ); } - out.unwrap() + out } else { - func(self) + Some(func(self)) } } }