Skip to content

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

Merged
mikayla-maki merged 1 commit intozed-industries:mainfrom
jkugs:fix/x11-scroll-delta-on-focusout
Dec 20, 2025
Merged

gpui: Reset mouse scroll state on FocusOut to prevent large jumps#43841
mikayla-maki merged 1 commit intozed-industries:mainfrom
jkugs:fix/x11-scroll-delta-on-focusout

Conversation

@jkugs
Copy link
Contributor

@jkugs jkugs commented Nov 30, 2025

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.

@cla-bot
Copy link

cla-bot bot commented Nov 30, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @jkugs on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@maxdeviant maxdeviant changed the title fix(x11): reset mouse scroll state on FocusOut to prevent large jumps gpui: Reset mouse scroll state on FocusOut to prevent large jumps Nov 30, 2025
@jkugs
Copy link
Contributor Author

jkugs commented Nov 30, 2025

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 30, 2025
@cla-bot
Copy link

cla-bot bot commented Nov 30, 2025

The cla-bot has been summoned, and re-checked this pull request!

@mikayla-maki
Copy link
Member

Thanks!

@mikayla-maki mikayla-maki merged commit e5eb26e into zed-industries:main Dec 20, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from Community PRs to Done in Quality Week – December 2025 Dec 20, 2025
rtfeldman pushed a commit that referenced this pull request Jan 5, 2026
…3841)

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.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…d-industries#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 zed-industries#34901.

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

Closes zed-industries#34901
Closes zed-industries#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.
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…d-industries#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 zed-industries#34901.

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

Closes zed-industries#34901
Closes zed-industries#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

2 participants