diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index ac7ac8cabc..8037132640 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -2496,8 +2496,6 @@ impl CollabPanel { .absolute() .right(rems(0.)) .h_full() - // HACK: Without this the channel name clips on top of the icons, but I'm not sure why. - .z_index(10) .child( h_flex() .h_full() diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 618c7eb4e4..3688b27552 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -859,15 +859,14 @@ impl<'a> WindowContext<'a> { // At this point, we've established that this opaque layer is on top of the queried layer // and contains the position: - // - If the opaque layer is an extension of the queried layer, we don't want - // to consider the opaque layer to be on top and so we ignore it. - // - Else, we will bail early and say that the queried layer wasn't the top one. - let opaque_layer_is_extension_of_queried_layer = opaque_layer.len() >= layer.len() - && opaque_layer - .iter() - .zip(layer.iter()) - .all(|(a, b)| a.z_index == b.z_index); - if !opaque_layer_is_extension_of_queried_layer { + // If neither the opaque layer or the queried layer is an extension of the other then + // we know they are on different stacking orders, and return false. + let is_on_same_layer = opaque_layer + .iter() + .zip(layer.iter()) + .all(|(a, b)| a.z_index == b.z_index); + + if !is_on_same_layer { return false; } } @@ -908,15 +907,14 @@ impl<'a> WindowContext<'a> { // At this point, we've established that this opaque layer is on top of the queried layer // and contains the position: - // - If the opaque layer is an extension of the queried layer, we don't want - // to consider the opaque layer to be on top and so we ignore it. - // - Else, we will bail early and say that the queried layer wasn't the top one. - let opaque_layer_is_extension_of_queried_layer = opaque_layer.len() >= layer.len() - && opaque_layer - .iter() - .zip(layer.iter()) - .all(|(a, b)| a.z_index == b.z_index); - if !opaque_layer_is_extension_of_queried_layer { + // If neither the opaque layer or the queried layer is an extension of the other then + // we know they are on different stacking orders, and return false. + let is_on_same_layer = opaque_layer + .iter() + .zip(layer.iter()) + .all(|(a, b)| a.z_index == b.z_index); + + if !is_on_same_layer { return false; } }