# gpui: Fix dropped frames when scrolling an unfocused window \(\#61600\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a50a292fd179f5a4391ee1442b00741a9925cc0f

Requested commit: a50a292fd179f5a4391ee1442b00741a9925cc0f

Commit: a50a292fd179f5a4391ee1442b00741a9925cc0f

Tree: 3b6923242dd7376680e2ce92deafd84b5d9b84c4

Author: Agus Zubiaga

Committer: GitHub

## Message

```
gpui: Fix dropped frames when scrolling an unfocused window (#61600)

Scroll events are delivered to the window under the pointer even when it
isn't focused, but we cap inactive windows at ~30fps to save energy, so
scrolling an unfocused window visibly drops frames. We now exempt
high-rate input from the cap using the existing `InputRateTracker`: a
trackpad scroll stream lifts it while events are arriving and for one
second after the last burst, then the cap resumes on its own.

## Self-Review Checklist:

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

---

Release Notes:

- Fixed dropped frames when scrolling unfocused windows.
```

## Parents

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

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