diff options
Diffstat (limited to 'lazy/src/responsive.rs')
-rw-r--r-- | lazy/src/responsive.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lazy/src/responsive.rs b/lazy/src/responsive.rs index da7bb408..35ad6974 100644 --- a/lazy/src/responsive.rs +++ b/lazy/src/responsive.rs @@ -6,6 +6,7 @@ use iced_native::layout::{self, Layout}; use iced_native::mouse; use iced_native::overlay; use iced_native::renderer; +use iced_native::window; use iced_native::{ Clipboard, Element, Hasher, Length, Point, Rectangle, Shell, Size, Widget, }; @@ -100,7 +101,10 @@ where ) -> event::Status { let mut internal = self.0.borrow_mut(); - if internal.state.last_size != Some(internal.state.last_layout.size()) { + if matches!(event, Event::Window(window::Event::Resized { .. })) + || internal.state.last_size + != Some(internal.state.last_layout.size()) + { shell.invalidate_widgets(); } @@ -268,7 +272,9 @@ where hasher.finish() }; - if new_layout_hash != state.last_layout_hash { + if state.last_size != Some(state.last_layout.size()) + || new_layout_hash != state.last_layout_hash + { state.last_layout = element.layout( renderer.deref(), &layout::Limits::new( |