TL;DR: Ubuntu turns on an accessibility service that makes Electron apps (VS Code, Spotify, Slack, etc.) run a hidden "screen reader" mode. Even if you don't use one. This kills scrolling and UI performance.
- Scrolling in the editor feels jittery or "heavy" instead of smooth
- Typing feels slightly delayed
- Tabs, menus, and the file sidebar feel sluggish
- The problem affects other apps too: Spotify feels laggy, Chrome pages scroll poorly, Slack is slow to switch channels
Open a terminal and run this while VS Code is running:
code --statusFind the line that says Screen Reader. If it shows yes and you don't use a
screen reader, you have this problem:
Screen Reader: yes ← this is the culprit
Ubuntu 24.04 includes a service called AT-SPI (Assistive Technology Service Provider Interface). It's the bridge that lets screen readers like Orca work with applications. Ubuntu starts it automatically for everyone, just in case you need it.
The problem: Electron (the framework behind VS Code, Spotify, Slack, Discord, and many other desktop apps) detects this service at startup and thinks "I need to prepare everything for a screen reader." It builds an entire second copy of the user interface (an "accessibility tree") and keeps it in sync with every scroll, keystroke, and animation.
If you don't use a screen reader, you're paying a 2–5× performance penalty for something you never asked for.
Three options, from quickest to most permanent.
Add these two lines to ~/.bashrc or corresponding according to the shell of your choice:
export GTK_MODULES=""
export QT_ACCESSIBILITY=0Then log out and back in. This tells your apps "don't load the accessibility bridge."
This stops the AT-SPI bus from ever starting, cleanly and permanently:
systemctl --user mask at-spi-dbus-bus.service
systemctl --user stop at-spi-dbus-bus.serviceIf you ever need it back:
systemctl --user unmask at-spi-dbus-bus.serviceIf you're certain you don't need any accessibility features:
sudo apt purge at-spi2-coreBefore running this, check what else would be removed:
apt purge --dry-run at-spi2-coreSome desktop applications list it as a dependency even if they work fine without it, so review the list before confirming.
- Log out and back in (or restart your computer).
- Launch VS Code.
- Run
code --statusin a terminal. - Confirm the line now says Screen Reader: no.
- Open a file and scroll — it should be smooth.
Any app built on Electron or Chromium is affected the same way:
| Application | What you'll notice |
|---|---|
| VS Code / VSCodium | Laggy scrolling, sluggish file sidebar |
| Google Chrome / Chromium | Jittery page scrolling, slow tab switching |
| Spotify | Slow playlist browsing, laggy UI |
| Slack | Sluggish typing, slow channel switching |
| Discord | Laggy chat scrolling |
| Obsidian | Jittery note editing |
| Signal Desktop | Slow message rendering |
| Figma desktop app | Sluggish canvas |
All of these use the same Chromium engine underneath. Disabling the accessibility bus fixes all of them at once.
Not really — every piece is working as intended:
- Ubuntu ships AT-SPI so accessibility tools work out of the box.
- Electron correctly enables accessibility support when it detects AT-SPI.
- The performance cost is a consequence of how Linux accessibility works (D-Bus round-trips per query), not a bug in any single component.
The mismatch is that accessibility is enabled globally even when no accessibility tool is in use. On Windows and macOS the accessibility APIs are always on but have much lower overhead because they're built into the OS compositor rather than running over a separate D-Bus bus.
Do not disable AT-SPI — you need it. Instead, try these to improve performance:
- Turn on GPU acceleration. Run
code --statusand check GPU Status →gpu_compositingsaysenabled. If it doesn't, make sure your graphics drivers are installed. - Use custom title bar. In VS Code settings:
"window.titleBarStyle": "custom"(this is the default, but some themes change it). - Try disabling extensions. Run
code --disable-extensionsto see if a specific extension is causing lag. - Use Wayland. VS Code on Ubuntu 24.04 uses Wayland by default. If you switched to X11 for compatibility, try switching back — Wayland generally has better GPU compositing.
If you use a custom window manager (Hyprland, Sway, niri) or a Nix-based configuration, the situation can be harder to diagnose. Custom setups often have their own environment variable handling that can disagree with the systemd user environment. You might see the fix work when launching VS Code from the app menu but not from a terminal, or vice versa.
In these cases, check both:
echo $GTK_MODULES # your shell
systemctl --user show-environment | grep GTK_MODULES # systemdIf they show different values, you have an environment mismatch, make sure your fix applies to both.