Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix hovering over elements nested inside their parents

Julia849a1324f70f
diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs
index ac7ac8cabce..8037132640d 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 618c7eb4e45..3688b27552c 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;
}
}