From cf01eff8d13303e232009e57fc772444379263df Mon Sep 17 00:00:00 2001 From: Konkitoman Date: Sun, 23 Jul 2023 11:57:36 +0300 Subject: [PATCH] Now a embedded window will only render in his parent window --- crates/egui/src/containers/window.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index 76e070307..b2be6fce0 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -458,6 +458,9 @@ impl<'open> Window<'open> { .show(ctx, |ui| Some(add_contents(ui))) }) } else { + if ctx.current_window() != ctx.current_rendering_window() { + return None; + } let frame = frame.unwrap_or_else(|| Frame::window(&ctx.style())); let is_explicitly_closed = matches!(open, Some(false));