diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 747bcec454..986ef03ec1 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -1088,8 +1088,16 @@ impl<'a> WindowContext<'a> { break; } - if bounds.contains(point) && !opaque_level.starts_with(level) { - return false; + if bounds.contains(point) { + let starts_with = opaque_level + .iter() + .zip(level.iter()) + .all(|(a, b)| a.z_index == b.z_index) + && opaque_level.len() >= level.len(); + + if !starts_with { + return false; + } } } true