vscode: Can't drag scroll bars anymore

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.56.2
  • OS Version: Debian 10

Steps to Reproduce:

  1. Open any file longer than the display height
  2. Try to drag the scrollbar or left-click in a empty scrollbar section.
  • Expected: drag-to-scroll, or scroll immediately to the clicked position.
  • Actual: no scroll.

Apparently the scrollbar is “missing” the click event. Clicking on the scrollbar is actually sending the click in the current editor itself. I can see the change in the opacity of the scroll indicator, however on click-and-drag VSCode is selecting text from the editor pane instead of scrolling.

Also, left-clicking everywhere over the scrollbar is not scrolling (the correct behavior is to scroll up to the click position immediately). The only way to scroll immediately on click is to use the right click.

No problem scrolling using mouse scroll wheel, or clicking over the minimap.

Currently I went back to 1.55.2 and the issue is not yet there. I also tried in 1.56.0 and the issue is present, so the bug was introduced somewhere between these two versions.

My current desktop environment is Debian 10 with Fluxbox. I tested with a clean install (I removed .vscode and .config/VSCode dirs). I also tried hiding the minimap. No effects, the issue is still there.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 27
  • Comments: 48 (4 by maintainers)

Most upvoted comments

run code with --disable-features=SendMouseLeaveEvents

same problem https://bugs.chromium.org/p/chromium/issues/detail?id=713746

I hit a somewhat similar issue on icewm (on Debian 11) : it occurs after switching windows (using keyboard or mouse). So the workaround is simple : switch virtual desktops or iconize-raise VScode.

I confirm it does not occur on 1.55.2. It does not occur using openbox WM.

lol, once mac users have this issues, they’re gonna take this issue seriously now

Certainly still an issue with:

Same issue here. Using Arch Linux, installation data:

  • Version: 1.61.2
  • Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643
  • Date: 2021-10-19T14:58:13.605Z
  • Electron: 13.5.1
  • Chrome: 91.0.4472.164
  • Node.js: 14.16.0
  • V8: 9.1.269.39-electron.0
  • OS: Linux x64 5.14.14-arch1-1

I noticed they start working if I make some clicks inside the file I want to scroll.

I can confirm the behavior running Manjaro and KDE Plasma 5.21.5. Switching to Gnome 40 on the same computer and scrolling works as expected. VS code is the only application I see this issue.

^ 1.83.0 still very much broken over here

Works with the special flag:

code . --disable-features=SendMouseLeaveEvents
Warning: 'disable-features' is not in the list of known options, but still passed to Electron/Chromium.

I came up with a way to reproduce this on linux with a minimal window manager. It seems to be related to some interaction that happens with the window manager wants to grab button presses with XGrabButton and then pass those through with XAllowEvents.

First, run Xephyr:

Xephyr -br -ac -noreset -screen 1024x800 :1

Run vscode:

DISPLAY=:1 code . --disable-extensions

At this point, all scroll bars are working. I’ve checked the terminal scroll bar, editor scroll bar, and the extensions one.

Here’s an example wm:

#include <X11/Xlib.h>
#include <stdio.h>

int main(void)
{
    Display * dpy;
    XEvent ev;

    if(!(dpy = XOpenDisplay(NULL))) return 1;

    XGrabButton(dpy, 1, AnyModifier, DefaultRootWindow(dpy), False,
            ButtonPressMask|ButtonReleaseMask|PointerMotionMask, GrabModeSync, GrabModeSync, None, None);

    for(;;)
    {
        XNextEvent(dpy, &ev);
        if(!(ev.xbutton.state & Mod1Mask))
        {
            printf("XAllowEvents\n");
            XAllowEvents(dpy, ReplayPointer, ev.xbutton.time);
        }
    }
}

To compile it:

gcc wm.c -lX11 -o wm 

Run the example window manager:

DISPLAY=:1 ./wm

At this point, the editor scroll bar and extensions scroll bars no longer work. The terminal one continues to work.

We can use some other tools to gather more information:

We can get the window id of vs code by running:

DISPLAY=:1 xwininfo

Click on vs code inside Xephyr. It should display the window id.

With this, we can print xevents with xev:

DISPLAY=:1 xev -id 0x200002

When trying to scroll by clicking on the bar, I get the following output:

LeaveNotify event, serial 19, synthetic NO, window 0x200002,
    root 0x52e, subw 0x0, time 1306485143, (1010,234), root:(1011,249),
    mode NotifyGrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 256

EnterNotify event, serial 19, synthetic NO, window 0x200002,
    root 0x52e, subw 0x0, time 1306485143, (1010,234), root:(1011,249),
    mode NotifyUngrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 256

KeymapNotify event, serial 19, synthetic NO, window 0x0,
    keys:  46  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

PropertyNotify event, serial 19, synthetic NO, window 0x200002,
    atom 0x159 (_NET_WM_USER_TIME), time 1306485144, state PropertyNewValue

I think the thing that’s throwing stuff off here is the LeaveNotify and EnterNotify. If you now kill the window manager, the scroll bars should correctly work again. Looking at xev, the LeaveNotify and EnterNotify events wont keep repeating, and only:

PropertyNotify event, serial 19, synthetic NO, window 0x200002,
    atom 0x159 (_NET_WM_USER_TIME), time 1306911717, state PropertyNewValue

I am facing same problem with my Debian 11 KDE plasma.

It seems to be related to some interaction that happens with the window manager wants to grab button presses with XGrabButton and then pass those through with XAllowEvents.

Some window managers, e.g. Fluxbox, send LeaveNotify/EnterNotify on click to ensure “activate window by click” feature. So sequence is:

LeaveNotify
EnterNotify
ButtonPress
EnterNotify

It’s not a problem if application handles these events correctly. Internal flag indicating button pressed should be set on ButtonPress and reset on ButtonRelease events only. But if application (or underlaying library) reset the flag on LeaveNotify/EnterNotify, we observe such weird behavior: button press is ignored.

I’m still having this issue on 1.73.1, Ubuntu.

I’ve noticed if I keep the minimap enabled, I can click to scroll, thus putting a band-aid on the issue. Hopefully that helps others who are currently pulling their hair out!

As of latest update the --disable-features=SendMouseLeaveEvents workaround doesn’t seem to work anymore 😞 .

No, the issue is not present in Chromium. I’m using Chromium Version 90.0.4430.212 (Developer Build). Shall i test that page with Chromium 89?