Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: scroll jumps randomly (related to Chrome, Electron, xinput) #28795

Open
Tracked by #197452
mariusa opened this issue Jun 15, 2017 · 375 comments
Open
Tracked by #197452

Editor: scroll jumps randomly (related to Chrome, Electron, xinput) #28795

mariusa opened this issue Jun 15, 2017 · 375 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron linux Issues with VS Code on Linux upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@mariusa
Copy link

mariusa commented Jun 15, 2017

  • VSCode Version: starting at 1.13.0, up to current
  • OS Version: Fedora 24-27

Looks like VS Code is listening to mouse scroll events, even while it is not active in the window.
Related:
https://bugs.chromium.org/p/chromium/issues/detail?id=608246
https://bugs.chromium.org/p/chromium/issues/detail?id=807187

Steps to Reproduce
requirements: Browser (Chromium / Firefox / Google Chrome), VSCode Editor (Any file type. Ideally a long file to ensure the scroll is visible.)

VSCode: Leave cursor at top of file.
Browser: Scroll, excessively, (For a few seconds) down the page. Even if it's a blank tab with no content.
VSCode: Scroll, ever so slightly, in any direction.
You'll find the editor will jump suddenly further down the active file.

It seems VSCode is receiving the scroll events, for whatever reason; which are all suddenly evaluated upon any form of scroll input in the editor.

Updates based on comments

GUESS: Appears to be an issue with Electron and some input libraries?
Is not isolated to VScode
Fix: Does not yet exist.

Linux Workarounds (Not to be confused with a fix)

imwheel - not suitable for all users
wayland - not suitable for all users
Note: Ubuntu 19.04 (Desktop) appears to be using Wayland.

I'm not sure we will see further updates in here, which is a bit disappointing from the developers, given the amount of comments from affected people. I would like to have some official guidance, even if it's pointing us to other resources.

@MattMcMurray
Copy link

MattMcMurray commented Jul 7, 2017

OS Ubuntu 16.04
VSCode Version 1.13.1

I'm getting a similar issue when Alt+Tabbing between windows.
E.g., Alt+Tab to Chrome to read docs, etc., Alt+Tab back to VSCode, scroll up or down one click on the mousewheel, but the page scrolls down at least 3-4 pages pretty consistently.

UPDATE: Issue still present with all extensions disabled.

@mariusa
Copy link
Author

mariusa commented Aug 7, 2017

This also happens with the right sidebar (Explorer) sometimes, when Alt+Tabbing between windows.
Version: 1.14.2

@rebornix rebornix added the under-discussion Issue is under discussion for relevance, priority, approach label Aug 11, 2017
@dmblack
Copy link

dmblack commented Nov 1, 2017

I've been experiencing this issue for a rather long time. I've never really put much thought into it, and it's not got worse; but I'm starting to really find this ever more frustrating. The actual impact to my productivity is beyond measure.

I'll find that this happens intermittently, but frequently - in which I'll attempt to scroll in the current file, and suddenly I'm scrolled to a location way out of bounds to the input. (Eg; I'm attempting to scroll a few lines, and suddenly I'm at the end of the file).

Some key thoughts may be;

  • Primarily using a touch pad - but I'm very confident this has happened from mouse scroll input also.
  • It's not related to the touch pad input bug - there's no delay - this is INSTANTLY scrolling to a, what I thought was random, section of the file (But as per reporter; may be the end of the file).
  • The scroll is not associated to cursor location (It's not just scrolling to where my current cursor is - more often than not, the cursor is where I'm scrolling from)
  • The scroll distance, as mentioned above, is way out of bounds of input - so cannot be a faulty device (Eg; the touch pad or mouse is actually attempting to scroll that distance)
  • As per @MattMcMurray I spend A LOT of time tabbing between files, CTRL + P quick switching between files, alt tabbing between windows, and workspace swapping.
  • As per @mariusa - I'm using Linux (Debian). I do not use macOS or Windows (So cannot provide tests for these environments).

I've deliberately left the version of Debian (Buster), and VSCode out of this note. I'm using latest of both, however this has most certainly been present for a long time.

I'll endeavor to provide further constructive input in attempts to discover where the problem lies, and attempt to pay more attention when it happens. @ramya-rao-a & @rebornix - I would expect this impacts a lot more users than reported here, hence tagging you here. Just a matter of how long before they too come to this level of frustration.

Edited; included additional information, tagged some people, and fixed some content.

@mariusa
Copy link
Author

mariusa commented Nov 2, 2017

Same here, just couldn't find a way to reproduce it reliably. It is painful indeed.
I don't use multiple workspaces, just alt tabbing between windows (also CTRL + P quick switching between files, but that doesn't seem to affect this). I use just mouse scroll, no touchpad.

@tmtke
Copy link

tmtke commented Nov 14, 2017

This is bugging me for quite some time, and I think I can reproduce it. It only happens (to me at least) if there is the mini search box at the top right corner of the editor. If I dismiss it, the scrolling disappears.

EDIT: I'm on Windows & OSX.

@dmblack
Copy link

dmblack commented Nov 15, 2017

@tmtke So you have definitely had this happen on Windows?

@tmtke
Copy link

tmtke commented Nov 16, 2017

@dmblack Yes, it happened on Windows.

@tmtke
Copy link

tmtke commented Nov 20, 2017

...damn, I think it's not that consistent. maybe a combination of the search box and the inline reference lines. I don't know nothing now :/

@nise
Copy link

nise commented Nov 28, 2017

I can confirm this behavior for Ubuntu 16.04, VC 1.18.1 if I switch between Chromium or Firefox back to VS Code. If switch back from Nautilus or Thunderbird for examples, everything works fine.

@arenddeboer
Copy link

I also experience this on Fedora 27
vscode Version 1.18.1

@dmblack
Copy link

dmblack commented Dec 11, 2017

I can finally, and consistently, reproduce. I can also confirm this not only impacts browsers like Chromium, Firefox, and Google Chrome, but other open applications. I can even have no applications open, only my Desktop visible, and reproduce.

For this example, simplified to ensure reliability; requirements: Browser (Chromium / Firefox / Google Chrome), VSCode Editor (Any file type. Ideally a long file to ensure the scroll is visible.)

  1. VSCode: Leave cursor at top of file.
  2. Browser: Scroll, excessively, (For a few seconds) down the page. Even if it's a blank tab with no content.
  3. VSCode: Scroll, ever so slightly, in any direction.

You'll find the editor will jump suddenly further down the active file.

It seems VSCode is receiving the scroll events, for whatever reason; which are all suddenly evaluated upon any form of scroll input in the editor.

@tmtke @mariusa Tagging you two, if you are able to please attempt to reproduce.

Something tells me this is actually an Electron bug. Unfortunately; I don't have any other Electron apps to test with.

Edit: I now have a Windows 10 box at home. Will endeavor to test and add results tonight.

@vacantgeologist
Copy link

vacantgeologist commented Dec 29, 2017

I was also able to reproduce this issue with Ubuntu 16.04. It doesn't matter what app I switch to (tested with Chromium, gedit) although I wasn't able to reproduce by scrolling on an empty desktop. I am not experiencing this with Windows 7. I do not believe that it has anything to do with find or extensions, because when I boot code with --disable-extensions and don't use the find feature, the issue still occurs consistently.

Edit: I don't mean to imply that something is related without better testing, but the Electron/Atom team has a very similar issue that was reported to Atom: atom/atom#15482 The description is nearly identical. There are some suggestions there about switching to Wayland, using editor in a different workspace, etc. I was able to confirm that putting VSCode in another workspace stopped the issue from happening. This looks like at least in my case it's not a VSCode-specific issue at the moment.

@tranhl
Copy link

tranhl commented Jan 3, 2018

As @dmblack surmises, it appears that this is an Electron bug. A related Atom issue has provided steps to reproduce the issue. It seems that Electron is receiving scroll events of Chromium applications that are on top of the Electron application and then replaying them after a scroll event on the Electron application.

Updating Electron seems to fix the issue though, so it's up to the vscode team to fix.

@dmblack
Copy link

dmblack commented Jan 3, 2018

@rebornix May we have your input (Tagging as it's assigned to yourself). Looks like this may be out of our hands otherwise.

  • Is there anything you would like us to try to confirm Electron?
  • Are there any plans for an Electron update with VSCode?

Thanks all others involved so far!

@tluanga34
Copy link

I'm having this issue. It's painful. VSCode is listening to mouse scroll event even while it is not active in the window.

@tluanga34
Copy link

I came to learn that this is a bug from Chromium project and so affecting VScode for being based on electron which use Chrome engine under the hood.

I just filed a bug: https://bugs.chromium.org/p/chromium/issues/detail?id=807187

Not sure if they are taking this seriously.

@arenddeboer
Copy link

arenddeboer commented Feb 5, 2018

I wonder if this really is an Electron bug. The Atom editor does not have this issue, and the current Atom version (1.23.3 ) is using a much older version of Electron:

ares: "1.10.1-DEV"
atom-shell: "1.6.15"
chrome: "56.0.2924.87"
electron: "1.6.15"
http_parser: "2.7.0"
modules: "53"
node: "7.4.0"
openssl: "1.0.2j"
uv: "1.10.1"
v8 : "5.6.326.50"
zlib: "1.2.8"

vs code 1.19.3 :

ares: "1.10.1-DEV"
atom-shell: "1.7.9"
chrome: "58.0.3029.110"
electron: "1.7.9"
http_parser: "2.7.0"
microsoft-build: "1.7.9"
modules: "54"
node: "7.9.0"
openssl: "1.0.2k"
uv: "1.11.0"
v8: "5.8.283.38"
zlib: "1.2.11"

If this is an issue in Electron, I suspect much more users would be impacted.
Is there a common extension or tool that triggers this behavior ?
It still happens to me when running vs code with: code --disable-extensions but not when running vscode and chrome on a clean install, without any extensions installed.

I also use PlatformIO and wakatime as extenions, perhaps I should try to install my extensions one by one and see when the issue starts popping up.

Anyway, this is becoming such a productivity drag that I don't see another option short of switching editors. If anyone has found a workaround, please share.

update:

  • also happens on clean install, no extensions installed
  • a rather awkward mitigation strategy is scroll up before scrolling down in vscode. This prevents the sudden scroll to bottom of document as it seems to clear the downward scroll buffer.

@Fullpan
Copy link

Fullpan commented Feb 5, 2018

The issue is somehow related to libinput. As a workaround, you can replace the libinput with evdev, in ubuntu with xorg it's:
"sudo apt remove xserver-xorg-input-libinput && sudo apt install xserver-xorg-input-evdev". But probably you will need to manually configure the mouse.

@dmblack
Copy link

dmblack commented Feb 6, 2018

@arenddeboer
There's a link earlier in this thread in which Atom demonstrates same, or similar, symptoms - posted by @vacantgeologist and @tranhl

Regarding your 'scroll up' first notes; In my experience; the editor will scroll up or down, entirely depending on your behavior in other applications. As per my testing; I found that this was happening in any application, or even just my desktop - not just other 'Electron' applications.

Regarding a workaround; there are some notes, kindly clarified by @Fullpan. I have not tested them, however; I'd be interested in your experience/result if you give this a go. Please pay close attention to their note regarding potential manual configuration of your mouse.

@mariusa
Could you please update the description / original information to include some additional information found by other users here. This will avoid other posts by users that may miss or misunderstand other content of this now much longer thread.

I'd encourage information or status updates by some of the appropriate developer stakeholders, but we do not seem to have much traction from them.

@mariusa mariusa changed the title Editor: scroll jumps randomly (after Find?) Editor: scroll jumps randomly (related to Chrome, Electron, xinput) Feb 6, 2018
@mariusa
Copy link
Author

mariusa commented Feb 6, 2018

@dmblack done
@ramya-rao-a Would you please assign to a more responsive developer?

@arenddeboer
Copy link

@dmblack thanks for the feedback.
@Fullpan thank you for the libinput / xorg reference.
It made me realize I had WaylandEnable=false set in /etc/gdm/custom.conf. Switching back to Wayland solved the issue for me.

@sebospc
Copy link

sebospc commented Feb 7, 2018

The same here in manjaro gnome when I scroll in chrome and then I press alt+tab to vs code, the scroll put me the end.
DISTRIB_RELEASE=17.1.2
kernel version 4.9.77-1-MANJARO
version vs code 1.19.3
version libinput 1.9.4-1

@bitc
Copy link

bitc commented Feb 24, 2018

This happens consistently when using synergy. It's very annoying. Relevant issue: symless/synergy-core#6038

@fentras
Copy link

fentras commented Mar 6, 2018

If you're using Ubuntu 17.10 with latest GNOME desktop environment you'll notice this bug too. I tried to install old Ubuntu DE "Unity" and use VSCode on it and I didn't noticed this bug. Everything worked as expected without any errors.

Linux 4.13, X11 with GNOME (not Wayland session)

@Esteban-Rocha
Copy link

Another victim of that bug here too, however I have been using zen mode and I'm getting a lower chance of that happening to me, also restarting chrome and VsCode seems in my case to help to "disconnect" the apps scroll events.

System is manjaro KDE plasma 5

@lucasresck
Copy link

I ended up reinstalling my OS because this became unbearable :). Installed Arch over Ubuntu and Brave over Chrome, now I can finally code in peace after months and months of my scroll jumping to another universe when I alt+tab back to my 900-line file.

I also considered changing my OS when I first faced this bug (more than a year ago 😳). It would be so drastic that I preferred to create the extension instead.

@elektronik2k5
Copy link

I also considered changing my OS when I first faced this bug (more than a year ago 😳). It would be so drastic that I preferred to create the extension instead.

@lucasresck a personal thank you from me - you're a life saver. This is a great example of how open source fails but also how just one person can make a great difference for many people. 🙇🏻‍♂️

@lucasresck
Copy link

I also considered changing my OS when I first faced this bug (more than a year ago 😳). It would be so drastic that I preferred to create the extension instead.

@lucasresck a personal thank you from me - you're a life saver. This is a great example of how open source fails but also how just one person can make a great difference for many people. 🙇🏻‍♂️

I appreciate your thanks! I would say that, if it weren't for open source, no solution would have emerged...

@Arne91
Copy link

Arne91 commented Sep 7, 2023

I ended up reinstalling my OS because this became unbearable :). Installed Arch over Ubuntu and Brave over Chrome, now I can finally code in peace after months and months of my scroll jumping to another universe when I alt+tab back to my 900-line file.

I also considered changing my OS when I first faced this bug (more than a year ago 😳). It would be so drastic that I preferred to create the extension instead.

@lucasresck Thank you so much! That bug drives me crazy. Perfect!

@sesenta
Copy link

sesenta commented Oct 8, 2023

@lucasresck ty

@starball5
Copy link

Related on Stack Overflow:

@culebron
Copy link

culebron commented Oct 21, 2023

Affects me, version 1.82.3, Ubuntu. No such thing happens in Sublime Text that I also use.

Can't reproduce as written in the OP. But it happens every 10 minutes or so.

@ArcaEge
Copy link

ArcaEge commented Nov 4, 2023

Still hasn't been fixed?

@BTCRob1993 BTCRob1993 mentioned this issue Nov 4, 2023
@ces-vunguyen
Copy link

Alt+Tab Scroll Workaround extension doesn't work in Ubuntu 23.10 :(

@lucasresck
Copy link

Alt+Tab Scroll Workaround extension doesn't work in Ubuntu 23.10 :(

The extension recently received Ubuntu 23.10 (GNOME 45) support but it's not included in GNOME Extensions store yet --- I'm working on this. However, one can manually install it from GitHub: instructions.

Let me know if it works for you!

@ces-vunguyen
Copy link

It works. Many thanks @lucasresck <3

@lucasresck
Copy link

Happy to share that extension's GNOME 45 (Ubuntu 23.10) support has just been added to GNOME Extensions store!

To install it, just open Alt+Tab Scroll Workaround and click to turn it on!

GNOME recently required all extensions to be manually updated to GNOME 45, therefore breaking this extension. Many thanks to @lbltavares and @ld-web who also worked in this update.

@FeatureSpitter
Copy link

So, let me get this straight, I need to patch my OS, to fix a bug that is from VSCode?

Software development is going the right path 👍

@starball5
Copy link

@FeatureSpitter No? This is not a VS Code bug. If you didn't read the comments above yours, you can find a summary of it here

@machineghost
Copy link

It 100% is a VS Code bug: I use tons of other applications and none of them have this issue. That is the very definition of an application-specific bug.

Now, it might well be a VS Code bug caused by a programming choice to rely on some sort of universal mechanism, where there's a bug in that universal mechanism ... but it still is a VS Code bug.

@starball5
Copy link

starball5 commented Jan 17, 2024

@machineghost open any Chromium-based application, such as Discord, Chrome, MS Teams, VS Code, etc., then go somewhere in it that has text and a scrollable element, and scroll to near the middle of the full scrollable area. Open another Chromium-based application and do the same. In the first application window, select some text and drag it near the top or bottom of the element to cause crolling to happen. Do so until a significant amount of drag-based scrolling has happened. Then scroll back to where you where when you started dragging the text. Then alt+tab to the other Chromium-based application and scroll a little bit. I repeat- this is not a VS Code bug. If you're going to whine about software (especially that you don't pay money for), at least try to be informed enough to not make false categorization assertions.

@Kastakin
Copy link

@machineghost open any Chromium-based application, such as Discord, Chrome, MS Teams, VS Code, etc., then go somewhere in it that has text and a scrollable element, and scroll to near the middle of the full scrollable area. Open another Chromium-based application and do the same. In the first application window, select some text and drag it near the top or bottom of the element to cause crolling to happen. Do so until a significant amount of drag-based scrolling has happened. Then scroll back to where you where when you started dragging the text. Then alt+tab to the other Chromium-based application and scroll a little bit. I repeat- this is not a VS Code bug.

Indeed. It is a mixture of Electron and X11 not working that well together. Being that X11 is mostly abandoned I don't think we are in for a real bug fix other than the aforementioned extension any time soon.

@starball5
Copy link

It is a mixture of Electron

Again, I said Chromium. I don't know if it goes any higher up, but it at least goes a level up from Electron to Chromium.

@FeatureSpitter
Copy link

I also happens with Slack for eg.

@machineghost
Copy link

machineghost commented Jan 18, 2024

@starball5 You missed my point (which, admittedly, I didn't make as well as I could have).

If I build a website with React, and React has a bug, I don't get tell my users "sorry, it's a React bug, not our problem". It doesn't matter if some other sites are broken also; our site is broken, while most other sites aren't: it's our bug.

If I need to go file a ticket for the React folks to get the bug fixed, or do whatever else, then that's what I need to do to fix our bug.

@Sanan4li
Copy link

Sanan4li commented Mar 6, 2024

Alt+Tab Scroll Workaround extension doesn't work in Ubuntu 23.10 :(

The extension recently received Ubuntu 23.10 (GNOME 45) support but it's not included in GNOME Extensions store yet --- I'm working on this. However, one can manually install it from GitHub: instructions.

Let me know if it works for you!

Thank you very much. It was very frustrating for me and thought it was VS code's issue.

@lucasresck
Copy link

lucasresck commented Mar 6, 2024

Alt+Tab Scroll Workaround extension doesn't work in Ubuntu 23.10 :(

The extension recently received Ubuntu 23.10 (GNOME 45) support but it's not included in GNOME Extensions store yet --- I'm working on this. However, one can manually install it from GitHub: instructions.
Let me know if it works for you!

Thank you very much. It was very frustrating for me and thought it was VS code's issue.

Happy to help, @Sanan4li! Please notice that GNOME 45 support is already out in the GNOME Extensions store.

@mikkorantalainen
Copy link

I believe the root cause is as I explained here: https://issues.chromium.org/issues/41251816#comment79

@Jhon-Mosk
Copy link

У меня такая же проблема на windows 10 и fedora 39

@hiphurraa
Copy link

7 years, and this bug still has not been fixed. Happens every time I scroll on Chrome or Vscode, and then alt+tab between them.

@the-rich-piana
Copy link

Are you fucking seriously expecting me to install an extension just so I can scroll properly? Wtf is Linux life man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron linux Issues with VS Code on Linux upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests