# gpui: Reset mouse scroll state on FocusOut to prevent large jumps \(\#43841\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e5eb26e8d600c1cf4b971ffa2df2344338ba6d48

Requested commit: e5eb26e8d600c1cf4b971ffa2df2344338ba6d48

Commit: e5eb26e8d600c1cf4b971ffa2df2344338ba6d48

Tree: e7b50711685b73b442d97e2ef4fe5ff78f81cdac

Author: jkugs

Committer: GitHub

## Message

```
gpui: Reset mouse scroll state on FocusOut to prevent large jumps (#43841)

This fixes an X11 scrolling issue where Zed may jump by a large amount
due to the scroll valuator state not being reset when the window loses
focus. If you Alt-Tab away from Zed, scroll in another application, then
return, the first scroll event in Zed applies the entire accumulated
delta instead of a single step.

The missing FocusOut reset was originally identified in issue #34901.

Resetting scroll positions on FocusOut matches the behavior already
implemented in the XinputLeave handler and prevents this jump.

Closes #34901
Closes #40538

Release Notes:

- Fixed an X11 issue where Alt-Tabbing to another application,
scrolling, and returning to Zed could cause the next scroll event to
jump by a large amount.
```

## Parents

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

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