From ee556282ed25a195aa3a3e1d6fdcb405f6f1c466 Mon Sep 17 00:00:00 2001 From: Jared Moulton Date: Thu, 14 Mar 2024 10:23:33 -0700 Subject: [PATCH] Stop overlay events from bubling through (#376) --- src/window_handle.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/window_handle.rs b/src/window_handle.rs index 272440e2..3818d0a0 100644 --- a/src/window_handle.rs +++ b/src/window_handle.rs @@ -1648,7 +1648,10 @@ impl Widget for WindowView { for_each: &mut dyn FnMut(&'a mut dyn Widget) -> bool, ) { for overlay in self.overlays.values_mut().rev() { - for_each(overlay); + if for_each(overlay) { + // if the overlay events are handled we don't need to run the main window events + return; + }; } for_each(&mut self.main); }