Vscode: Heterogeneous DPI support on Linux

Created on 9 Jan 2018  路  18Comments  路  Source: microsoft/vscode

  • VSCode Version: Code 1.19.1 (0759f77bb8d86658bc935a10a64f6182c5a1eeba, 2017-12-19T09:41:01.414Z)
  • OS Version: Linux x64 4.14.11-300.fc27.x86_64

Steps to Reproduce:

  1. A Wayland desktop session on a multi-display setup with heterogeneous DPI scaling. Mine is a HiDPI laptop display scaled at 200% and an external monitor using 100% scaling, resulting in xwayland scaled at 100% on all displays. gnome-shell is the compositor.
  2. Launch Visual Studio Code.
  3. Move the IDE window between the displays.

Like any other X11 application, Visual Studio Code cannot adapt to heterogeneous scaling.
Wayland support, discussed in #1739, is needed to enable this. I feel that opening a new issue is justified by the problem described, which was not mentioned by the commenters on that issue.


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

electron feature-request linux upstream upstream-issue-linked workbench-os-integration

Most helpful comment

I would say that the chromium issue is solved enough to support this, at least for testing purposes.

The current stable chromium release only requires the ozone/wayland build flags to be compiled for ozone/wayland (no downstream patches). It works, and correctly scales the window to match the DPI of the display it's rendered on.

All 18 comments

Does Chromium support this?

Does Chromium support this?

As much as I could find, there have been some efforts last year to develop Wayland display support for Chromium:
https://github.com/intel/ozone-wayland
https://blogs.igalia.com/tonikitoo/2017/05/17/chromium-musozone-update-h12017-wayland-x11/

Here's an active development branch for the Ozone port for Wayland: https://github.com/Igalia/chromium/tree/ozone-wayland-dev

Any news on this?

This is a huge blocker for me. Any movement on this issue? Moving to a Wayland port would solve this problem and possibly other linux display-related issues.

Unfortunately the Wayland issue #1739 was closed prematurely without a solution.

@jhasse Nooooope.
Capture d鈥櫭ヽran de 2019-04-21 18-58-43

Obviously an issue for VSCode as well.
Capture d鈥櫭ヽran de 2019-04-21 19-00-03

_Previous screens are 1080p on 24" screen. You can imagine how it's not cool to work with..._

Ubuntu 19.04/Wayland on a Dell XPS 2014 with 1080p HP side screen.

For a _half_ workaround (which is far from ideal as the menu bar still stays huge), you can zoom out with CTRL+-. At least your editor will be small.

If you are not using the menu bar (File, Edit ...) then you can even hide it with

    "window.menuBarVisibility": "hidden"

We are building exploration builds that use a much newer version of our UI framework (Electron version 6.0.x). I wonder if this issue reproduces with one of these builds, could you try? Download:

@bpasero there are two upstream bugs which are blocking this:

Until both of these are closed none of the updated Electron builds will solve the blurriness under Wayland as they'll be running via XWayland which has no means of knowing the DPI of the display it's on. At the moment the window will be upscaled from the lowest display's DPI to the display it's currently on. On a laptop with a 4k display and external 1080p display this means Code will look right on the external display and blurry on the 4k one.

I would say that the chromium issue is solved enough to support this, at least for testing purposes.

The current stable chromium release only requires the ozone/wayland build flags to be compiled for ozone/wayland (no downstream patches). It works, and correctly scales the window to match the DPI of the display it's rendered on.

@bpasero would be awesome if you could hook us up with such builds

@bpasero These builds did nothing for me. Still experiencing this issue on latest GNOME/latest Fedora with fractional DPI scaling set to 125%.

On Fedora 31 (on a 1440p laptop display) any scale other than 100% results in a blurry window - including 200%
Screenshot from 2019-11-23 00-40-17

Any updates on this? VSCode has become painful to use on Linux due to this.

Any updates on this? VSCode has become painful to use on Linux due to this.

@kaepora, things are moving, see https://github.com/electron/electron/issues/10915#issuecomment-558387649 for recent progress.

@tjanez Thank you, I've switched back to Xorg until this is resolved. Thankfully, VSCode works great on HiDPI on Xorg but I do miss the Wayland advantages across the rest of my computer.

It looks like the native Wayland support in Chromium/Electron is just about ready, so hopefully VSCode will soon be able to take advantage of that...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

v-pavanp picture v-pavanp  路  3Comments

villiv picture villiv  路  3Comments

sirius1024 picture sirius1024  路  3Comments

chrisdias picture chrisdias  路  3Comments

curtw picture curtw  路  3Comments