zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.42k stars 2.05k forks source link

Scrolling on X11 skips/lags when window is in focus #12690

Open jvmncs opened 4 weeks ago

jvmncs commented 4 weeks ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Reproduction: On Ubuntu 22.04 with default window manager / X11, open any file in a Zed project and try to scroll it.

Outcome: Scrolling lags, only rendering the final landing position of the scroll action. Observed behavior is as if Zed is only re-rendering the text file view once out of every N frame refreshes for some large-ish N. A previous issue (#11206) referred to this as "snapping".

Strangely, if I move the Zed window out of focus and scroll it, scrolling works normally. So I suppose you can describe this issue as the inverse case of #11206.

Originally, I thought it might be only for large files, but I've confirmed this is the case even for a Python file that's ~150 lines.

Environment

Zed: v1.0.0 (Zed Dev 18e2b43d6d3066cea08fe426f0d1c47bc048fdc5) OS: Linux 1.0.0 Memory: 62.7 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

jvmncs commented 4 weeks ago

here's a video to demonstrate. note that in this video, when I scroll very slowly it works, but when I scroll a longer distance it skips/lags. also note that when I click out of the window focus (at ~13s in the video), scrolling works fine like any other window. when I click back into focus in Zed (~21s), the problem reappears Screencast_from_06-05-2024_023439_PM.webm

prvnsmpth commented 3 weeks ago

I noticed a similar issue, also on Ubuntu 22.04 (Zed a910f192d). When you switch windows to another app, scroll for a bit, and then come back to Zed and scroll, the scroll bar snaps much farther than the expected scroll distance. It's as if Zed is still listening to and handling scroll events even when the window is out of focus.

wichops commented 3 weeks ago

The same is happening to me in Manjaro with X11 and Zed dev 0.140.0

jvmncs commented 1 week ago

this issue was resolved for me in Zed: v0.143.0 (Zed Dev 2dc840132bf2477b5d23d8836b3879f429e0bcf2) @wichops can you confirm on your end too? would like to close this if it's been resolved by some other changes