# gpui: Fix stuck tooltips after mouse leaves origin \(\#58134\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/507d043d960d4f2a1cd0b382f51bcd3ec20f6e9a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 507d043d960d4f2a1cd0b382f51bcd3ec20f6e9a

Requested commit: 507d043d960d4f2a1cd0b382f51bcd3ec20f6e9a

Commit: 507d043d960d4f2a1cd0b382f51bcd3ec20f6e9a

Tree: 96f6cf97d03b6de2fee593a67341aed9487f8b79

Author: Mayank Verma

Committer: GitHub

## Message

```
gpui: Fix stuck tooltips after mouse leaves origin (#58134)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

I encountered this bug while building my app with GPUI where tooltips
were getting stuck when i move my mouse away from the origin element.

Zed kinda gets away with it because tab close buttons use
`visible_on_hover`, so when the mouse leaves the tab, close button
disappears. This triggers a redraw which makes GPUI recheck and hide the
tooltip.

In the "Before" version i had to trigger the recheck by moving my mouse
over an element with hover styles to make the tooltip disappear.

### Before


https://github.com/user-attachments/assets/f405620f-6d6d-4a24-8992-214180bc7b76

### After


https://github.com/user-attachments/assets/2e41fbca-af61-4f34-bd5d-ab288f34e73a
```

## Parents

- [7cb01e42ef8766b18a919410ce2708135ca7ea46](https://git.cafe/gitcafe/zed/commit/7cb01e42ef8766b18a919410ce2708135ca7ea46?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/507d043d960d4f2a1cd0b382f51bcd3ec20f6e9a?format=markdown)
