From 78e1512c124a9b702f6c2b244ad7dd986032e40e Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 19:13:23 +0200 Subject: [PATCH] Revert "Invalidate tooltips when mouse leaves element's hitbox (#22488)" (cherry-pick #22542) (#22544) Cherry-picked Revert "Invalidate tooltips when mouse leaves element's hitbox (#22488)" (#22542) This reverts commit 344284e01331667c018e6ade5d791a20598a3a5c. That change broke git blame tooltips, as Zed should also show tooltips which are hovered, even though the mouse had left the origin element's bounds. Release Notes: - N/A Co-authored-by: Kirill Bulatov --- crates/gpui/src/elements/div.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/crates/gpui/src/elements/div.rs b/crates/gpui/src/elements/div.rs index 28c0969498cbc6fc75f42fabcaa250481b29d249..3f826ca00790bea20cce77fb54f8a6e2ee91e91f 100644 --- a/crates/gpui/src/elements/div.rs +++ b/crates/gpui/src/elements/div.rs @@ -1417,19 +1417,6 @@ impl Interactivity { None }; - let invalidate_tooltip = hitbox - .as_ref() - .map_or(true, |hitbox| !hitbox.bounds.contains(&cx.mouse_position())); - if invalidate_tooltip { - if let Some(active_tooltip) = element_state - .as_ref() - .and_then(|state| state.active_tooltip.as_ref()) - { - *active_tooltip.borrow_mut() = None; - self.tooltip_id = None; - } - } - let scroll_offset = self.clamp_scroll_position(bounds, &style, cx); let result = f(&style, scroll_offset, hitbox, cx); (result, element_state)