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

Heterogeneous DPI support on Linux #41345

Open
mzabaluev opened this issue Jan 9, 2018 · 27 comments
Open

Heterogeneous DPI support on Linux #41345

mzabaluev opened this issue Jan 9, 2018 · 27 comments
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality 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 workbench-os-integration Native OS integration issues
Milestone

Comments

@mzabaluev
Copy link

  • VSCode Version: Code 1.19.1 (0759f77, 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

@bpasero bpasero added upstream Issue identified as 'upstream' component related (exists outside of VS Code) electron Issues and items related to Electron and removed workbench labels Jan 9, 2018
@jhasse
Copy link
Contributor

jhasse commented Jan 12, 2018

Does Chromium support this?

@mzabaluev
Copy link
Author

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/

@mzabaluev
Copy link
Author

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

@trickreich
Copy link

Any news on this?

@qguv
Copy link

qguv commented Feb 8, 2019

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.

@Nek-
Copy link

Nek- commented Apr 21, 2019

@jhasse Nooooope.
Capture d’écran de 2019-04-21 18-58-43

Obviously an issue for VSCode as well.
Capture d’écran 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.

@jkrnak
Copy link

jkrnak commented Jun 12, 2019

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"

@bpasero bpasero added feature-request Request for new features or functionality linux Issues with VS Code on Linux workbench-os-integration Native OS integration issues labels Oct 8, 2019
@bpasero bpasero removed their assignment Oct 8, 2019
@bpasero
Copy link
Member

bpasero commented Oct 10, 2019

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 bpasero self-assigned this Oct 10, 2019
@bpasero bpasero added the info-needed Issue requires more information from poster label Oct 10, 2019
@LukeCarrier
Copy link

@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.

@bpasero bpasero added upstream-issue-linked This is an upstream issue that has been reported upstream and removed info-needed Issue requires more information from poster labels Oct 10, 2019
@bpasero bpasero added this to the Backlog milestone Oct 24, 2019
@bpasero bpasero removed their assignment Oct 28, 2019
@hedgepigdaniel
Copy link

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.

@LennyPenny
Copy link

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

@bpasero
Copy link
Member

bpasero commented Nov 11, 2019

@deepak1556 fyi on #41345 (comment)

@nadimkobeissi
Copy link

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

@ecnepsnai
Copy link

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

@nadimkobeissi
Copy link

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

@tjanez
Copy link

tjanez commented Nov 27, 2019

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

@KAepora, things are moving, see electron/electron#10915 (comment) for recent progress.

@nadimkobeissi
Copy link

@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.

@schmod
Copy link

schmod commented Oct 4, 2020

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...

@superhero75
Copy link

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...

This is april 2021. Gnome 40 is already out and neither chrome nor vscode supports hidpi monitor scaling on wayland. I tried all the quick fix on the web but none works. Is there any progress ?

@qcasey
Copy link

qcasey commented Apr 12, 2021

@trickreich
Copy link

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...

This is april 2021. Gnome 40 is already out and neither chrome nor vscode supports hidpi monitor scaling on wayland. I tried all the quick fix on the web but none works. Is there any progress ?

In fact this was the reason why I've switched off from Linux as my main OS..

@darkbasic
Copy link

darkbasic commented Apr 12, 2021

This is april 2021. Gnome 40 is already out and neither chrome nor vscode supports hidpi monitor scaling on wayland. I tried all the quick fix on the web but none works. Is there any progress ?

Did you try with KDE Plasma (on Wayland) and an electron 12 build of vscode? AFAIK it used to work even with XWayland vscode, but it was blurry (shouldn't if you use compile it from the electron 12 branch). Don't know about Gnome though.

@darkbasic
Copy link

In fact this was the reason why I've switched off from Linux as my main OS..

I know that feeling, that's really a dealbreaker... A friend of mine got it sort of working with Wayland Plasma, but at the time it was so unstable that he decided to match the dpi of the laptop.

@carwyn
Copy link

carwyn commented Apr 12, 2021

See #109176 and #120034 - The latter has some exploration builds which do run with nice sharp text under Wayland.

@hfluz
Copy link

hfluz commented Apr 17, 2021

See #109176 and #120034 - The latter has some exploration builds which do run with nice sharp text under Wayland.

@carwyn , do I have to set any variable in those exploration builds? I installed the rpm package on Fedora 34, but it still runs on xwayland.

NVM, I checked the aur package and found out that I had to add --enable-features=UseOzonePlatform --ozone-platform=wayland parameters in /usr/bin/code-exploration:

ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --enable-features=UseOzonePlatform --ozone-platform=wayland "$@"

@edrex
Copy link

edrex commented Jun 14, 2022

#72759 is a duplicate issue with a number of up-to-date user reports after the recent upgrade from Electron 14 to 17.

With #148507 fixed in insider, this is the first time VSCode is running stably for me as a native Wayland client, so scaling support is the last blocking issue for this to be usable.

@shuhaowu
Copy link

shuhaowu commented Feb 1, 2023

I have noted while using wayland fractional scaling with two monitors at 150% and 100% and launching VS code with the arguments --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations gives me a blurry VS code on the 150% screen. Interestingly, only the code editor region is blurry. The menu and the developer tools panel are not blurry. This is suggesting that some thing from VScode is rendering at the lowest scale between the two monitors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electron Issues and items related to Electron feature-request Request for new features or functionality 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 workbench-os-integration Native OS integration issues
Projects
None yet
Development

No branches or pull requests