diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0f3c5..c542568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fixed a panic that could occur when removing some deeply nested hierarchies - from a window. +- Fixed a panic that could occur when removing certain nested hierarchies from a + window. ### Added diff --git a/src/widget.rs b/src/widget.rs index bb4f48d..cd1a475 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -919,7 +919,8 @@ pub trait MakeWidget: Sized { Window::new(self.make_widget()) } - /// Returns a builder for a [`VirtualWindow`](crate::window::VirtualWindow). + /// Returns a builder for a [`VirtualWindow`](crate::window::VirtualWindow) + /// or a [`CushyWindow`](crate::window::CushyWindow). fn build_virtual_window(self) -> CushyWindowBuilder { CushyWindowBuilder::new(self) } diff --git a/src/widgets/switcher.rs b/src/widgets/switcher.rs index dc757d9..d23f755 100644 --- a/src/widgets/switcher.rs +++ b/src/widgets/switcher.rs @@ -54,7 +54,8 @@ impl WrapperWidget for Switcher { available_space: Size, context: &mut LayoutContext<'_, '_, '_, '_>, ) -> Size { - if self.source.has_updated() { + let current_source = self.source.get_tracking_invalidate(context); + if ¤t_source != self.child.widget() { self.child.unmount_in(context); self.child = WidgetRef::new(self.source.get()); } diff --git a/src/window.rs b/src/window.rs index d203c5d..409564b 100644 --- a/src/window.rs +++ b/src/window.rs @@ -2474,7 +2474,7 @@ impl PlatformWindowImplementation for &mut VirtualState { } } -/// A builder for a [`VirtualWindow`]. +/// A builder for a [`VirtualWindow`] or a [`CushyWindow`]. pub struct CushyWindowBuilder { widget: WidgetInstance, multisample_count: NonZeroU32, @@ -2484,7 +2484,7 @@ pub struct CushyWindowBuilder { } impl CushyWindowBuilder { - /// Returns a new builder for a Cushy window that contains `contents`. + /// Returns a new builder for a standalone window that contains `contents`. #[must_use] pub fn new(contents: impl MakeWidget) -> Self { Self {