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 · 399 comments
Open
Tracked by #197452

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

mariusa opened this issue Jun 15, 2017 · 399 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: deskflow/deskflow#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

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.

@mikkorantalainen
Copy link

This used to be buggy for be but both VS Code and Chrome no longer show this behaviour for me. I'm using XFCE so I don't know if the workaround is applied by Blink or my window manager.

It's clear that Blink ignores first scroll event after window focus, which is not optimal but better than random scrolling.

@mminot-yseop
Copy link

I'm using XFCE so I don't know if the workaround is applied by Blink or my window manager.

Dunno what Blink is, but I’m still getting the issue on my (arguably old) XFCE (4.14).

@wilhem-meignan
Copy link

wilhem-meignan commented Jun 3, 2024

I have this issue on Ubuntu 22.04 switching between Chrome and VS Code.

This gnome extension seems to fix it:
https://github.com/lucasresck/gnome-shell-extension-alt-tab-scroll-workaround

Ubuntu:
Ubuntu 22.04.4 LTS

Chrome:
Version 125.0.6422.141 (Official Build) (64-bit)

VS Code:
Version: 1.89.1
Commit: dc96b83
Date: 2024-05-07T05:16:23.416Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 6.5.0-35-generic

@pfirsich
Copy link

pfirsich commented Jun 6, 2024

Still have this problem with VSCode 1.89.1 on Debian Bookworm (12).

@eric-burel
Copy link

eric-burel commented Jun 14, 2024

Possible alternative direction:

  • if you hit this issue, you may not have Wayland enabled, but X11 instead.

image

  • if you can't swap to wayland, that may be because of incompatibility with NVidia cards, see this Reddit thread for some insights

  • Since I can't switch to Wayland or fix this issue, I am currently using SimpleBrowser for easy switch between VS Code and Chrome (so I stay into VS code but have a browser in a tab). Another possibility is to display VS Code in separate desktop to avoid the Alt+tab shortcut

This issue can quickly turns a developer life into a nightmare though :/

@lucasresck
Copy link

Since I can't switch to Wayland or fix this issue

Have you tested the Alt+Tab Scroll Workaround GNOME Extension?

@wilhem-meignan
Copy link

Salut Éric,

Thanks for the information! The bug does indeed occur with X11 but not with Wayland on my system. In my experience, the "Alt+Tab Scroll Workaround" Gnome extension makes things much better but is not a perfect fix. I had a few instances of erratic scrolling with the extension. Not with VS Code / Chrome but with other applications which did not have scroll problems without the extension. Like for example the Settings app.

Cheers,
Will

@lucasresck
Copy link

lucasresck commented Jun 14, 2024

In my experience, the "Alt+Tab Scroll Workaround" Gnome extension makes things much better but is not a perfect fix. I had a few instances of erratic scrolling with the extension. Not with VS Code / Chrome but with other applications which did not have scroll problems without the extension. Like for example the Settings app.

Please report this as an issue in the extension's repository so that we can sort this out. Thank you!

@wilhem-meignan
Copy link

Hi Lucas,

I saw the view jump unexpectedly in the settings app so I instantly though about the work-around. But I can't reproduce it at will and may have attributed it a bit quickly. I don't think I have enough data for a meaningful ticket right now.

@rafaberaldo
Copy link

rafaberaldo commented Jun 16, 2024

Having the same issue on Fedora 40 (Xorg).

Version: 1.90.1
Commit: 611f9bfce64f25108829dd295f54a6894e87339d
Date: 2024-06-11T21:02:43.666Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Linux x64 6.8.11-300.fc40.x86_64

@DGolubets
Copy link

At least I'm not alone on this one..

Ubuntu 22.04.
I can't switch do Wayland due to other bugs making it even worse alternative.
The extension mentioned above does nothing for me.

@gersonjferreira
Copy link

The imwheel fix works, but I have a question. How can I specify on .imwheelrc that it should apply the settings only to the vscode window? I've tried replacing the window title selector ".*", but it didn't work.

If this .imwheelrc is applied globally, it messes with CTRL+scroll in other applications (zoom in/out on browser, text editors, etc...). So, a proper fix should apply only to the vscode window.

Another question: does this issue affects only gnome users? Or kde as well?

Here's my .imwheelrc

".*"
None,      Up,     Button4, 1
None,      Down,   Button5, 1
None,      Thumb1, Alt_L|Left
None,      Thumb2, Alt_L|Right
Control_L, Up,     Control_L|Button4
Control_L, Down,   Control_L|Button5
Shift_L,   Up,     Shift_L|Button4
Shift_L,   Down,   Shift_L|Button5

And this is the desktop entry on ~/.config/autostart

[Desktop Entry]
Type=Application
Name=Imwheel VSCode
Exec=imwheel --kill --buttons 4 5
Comment=Fix VSCode scroll
X-GNOME-Autostart-enabled=true

@gersonjferreira
Copy link

gersonjferreira commented Jun 19, 2024

The Alt+Tab Scroll Workaround is also not always working for me anymore. Sometimes it fails, but I cannot identify when/why it fails. When it fails, it seems that I have to disable/enable the extension to work again.

@mminot-yseop
Copy link

does this issue affects only gnome users? Or kde as well?

Dunno for KDE, but considering that I have this issue on XFCE (which has not migrated to Wayland yet and cannot use Gnome extensions AFAIK), I wouldn’t be surprised if KDE was affected as well.

@lucasresck
Copy link

The extension mentioned above does nothing for me.

The Alt+Tab Scroll Workaround is also not always working for me anymore. Sometimes it fails, but I cannot identify when/why it fails.

@DGolubets and @gersonjferreira, thank you for your feedback. Please, open an issue at the repository so that we can investigate this.

@gersonjferreira
Copy link

@lucasresck, I would... but I wound't know what to report, since I cannot identify when/why it happens. It just sometimes fails. Is there a way for me to check if the extension is running on ps aux or something like this? Something independent of checking the gnome extension managers?

@lucasresck
Copy link

@gersonjferreira, I'm not sure... We would need to investigate a little bit more. A possible way could be logging each time the extension is triggered.

But, in either case, if you want to follow up with this, taking this issue to the repository seems to be more appropriated.

@pfirsich
Copy link

I know it's likely an Electron bug, but can you please just fix this in VSCode? Just throw away scroll events when the window gains focus. This is so massively infuriating and such a longstanding issue. If any of the developers had this issue for a single day I would guess it would have been fixed already. It is one of the most annoying bugs I ever encountered.

@gersonjferreira
Copy link

Indeed! I've actually moved from VSCode to PyCharm because of this bug. I'm using the free academic license of PyCharm Pro. It's working perfectly and I don't miss VSCode at the moment.

The PyCharm interface runs clean and now I try hard to avoid anything that uses Electron.

@dienluong
Copy link

dienluong commented Sep 18, 2024

Wow! I was looking on the internet for anyone with the annoying problem I'm experiencing but was looking at more recent issues. Can't believe this is a 7-year old annoyance!
Good job by the reporter for figuring out what's causing this. It's easily reproducible using the steps that person provided. (I can do it now just by scrolling on this webpage on Firefox and atl-tab back to VS Code.)

Edit: looks like it may be helpful to vote for these fixes:
https://issues.chromium.org/issues/41367836
https://issues.chromium.org/issues/41251816

Looks like the best course of action for now is install the work around by @lucasresck:
https://github.com/lucasresck/gnome-shell-extension-alt-tab-scroll-workaround

@FeatureSpitter
Copy link

image

@CsatiZoltan
Copy link

The same happens in VSCodium. Super annoying.

@mminot-yseop
Copy link

mminot-yseop commented Oct 16, 2024

The same happens in VSCodium. Super annoying.

Probably nearly every Electron-based app is affected. Heck, even in Slack, sometimes I get teleported far down the list of recent threads.

On XFCE I alleviate this by placing each affected app on a workspace (or physical screen) of its own, so that nothing overlaps it. This could be a strategy for other desktop environments as well, if you can’t use the aforementioned Gnome extension.

@CsatiZoltan
Copy link

@mminot-yseop Thanks, I installed the Gnome extension.

As for Slack, I use the web version, so I have no such problem.

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