From 9ca28093b66b0832e904b94754004b685ce41a5a Mon Sep 17 00:00:00 2001 From: Olivier FAURE Date: Thu, 5 Dec 2024 16:02:42 +0100 Subject: [PATCH] Add special case when window is resized to zero --- masonry/src/event_loop_runner.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/masonry/src/event_loop_runner.rs b/masonry/src/event_loop_runner.rs index c30efb576..4b3bcdcff 100644 --- a/masonry/src/event_loop_runner.rs +++ b/masonry/src/event_loop_runner.rs @@ -479,6 +479,12 @@ impl MasonryState<'_> { event_loop.exit(); } WinitWindowEvent::Resized(size) => { + if size.width == 0 || size.height == 0 { + self.handle_suspended(event_loop); + return; + } else if let WindowState::Suspended { .. } = &mut self.window { + self.handle_resumed(event_loop); + } self.render_root .handle_window_event(WindowEvent::Resize(size)); }